Skip to content

Commit

Permalink
Use data component of cdms2 variables for plotting
Browse files Browse the repository at this point in the history
  • Loading branch information
ajdawson committed Oct 25, 2016
1 parent c5618e8 commit bd23ec0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion examples/cdms/hgt_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
ax = plt.axes(projection=proj)
ax.set_global()
ax.coastlines()
ax.contourf(lons, lats, eof1(squeeze=True), levels=clevs,
ax.contourf(lons, lats, eof1(squeeze=True).data, levels=clevs,
cmap=plt.cm.RdBu_r, transform=ccrs.PlateCarree())
plt.title('EOF1 expressed as covariance', fontsize=16)

Expand Down
4 changes: 2 additions & 2 deletions examples/cdms/sst_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
lons, lats = eof1.getLongitude()[:], eof1.getLatitude()[:]
clevs = np.linspace(-1, 1, 11)
ax = plt.axes(projection=ccrs.PlateCarree(central_longitude=190))
fill = ax.contourf(lons, lats, eof1(squeeze=True), clevs,
fill = ax.contourf(lons, lats, eof1(squeeze=True).data, clevs,
transform=ccrs.PlateCarree(), cmap=plt.cm.RdBu_r)
ax.add_feature(cfeature.LAND, facecolor='w', edgecolor='k')
cb = plt.colorbar(fill, orientation='horizontal')
Expand All @@ -56,7 +56,7 @@
# Plot the leading PC time series.
plt.figure()
years = range(1962, 2012)
plt.plot(years, pc1, color='b', linewidth=2)
plt.plot(years, pc1.data, color='b', linewidth=2)
plt.axhline(0, color='k')
plt.title('PC1 Time Series')
plt.xlabel('Year')
Expand Down

0 comments on commit bd23ec0

Please sign in to comment.