Skip to content

Commit 98e6a4b

Browse files
fujiisoupshoyer
authored andcommitted
reduce memory consumption. (#2220)
1 parent e397299 commit 98e6a4b

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

doc/interpolation.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -219,16 +219,16 @@ Let's see how :py:meth:`~xarray.DataArray.interp` works on real data.
219219
.. ipython:: python
220220
221221
# Raw data
222-
ds = xr.tutorial.load_dataset('air_temperature')
222+
ds = xr.tutorial.load_dataset('air_temperature').isel(time=0)
223223
fig, axes = plt.subplots(ncols=2, figsize=(10, 4))
224-
ds.air.isel(time=0).plot(ax=axes[0])
224+
ds.air.plot(ax=axes[0])
225225
axes[0].set_title('Raw data')
226226
227227
# Interpolated data
228228
new_lon = np.linspace(ds.lon[0], ds.lon[-1], ds.dims['lon'] * 4)
229229
new_lat = np.linspace(ds.lat[0], ds.lat[-1], ds.dims['lat'] * 4)
230230
dsi = ds.interp(lat=new_lat, lon=new_lon)
231-
dsi.air.isel(time=0).plot(ax=axes[1])
231+
dsi.air.plot(ax=axes[1])
232232
@savefig interpolation_sample3.png width=8in
233233
axes[1].set_title('Interpolated data')
234234
@@ -247,7 +247,7 @@ The remapping can be done as follows
247247
dims=['x', 'z'], coords={'x': x, 'z': z})
248248
249249
fig, axes = plt.subplots(ncols=2, figsize=(10, 4))
250-
ds.air.isel(time=0).plot(ax=axes[0])
250+
ds.air.plot(ax=axes[0])
251251
# draw the new coordinate on the original coordinates.
252252
for idx in [0, 33, 66, 99]:
253253
axes[0].plot(lon.isel(x=idx), lat, '--k')
@@ -256,6 +256,6 @@ The remapping can be done as follows
256256
axes[0].set_title('Raw data')
257257
258258
dsi = ds.interp(lon=lon, lat=lat)
259-
dsi.air.isel(time=0).plot(ax=axes[1])
259+
dsi.air.plot(ax=axes[1])
260260
@savefig interpolation_sample4.png width=8in
261261
axes[1].set_title('Remapped data')

0 commit comments

Comments
 (0)