issue_comments: 157413923
This data as json
html_url | issue_url | id | node_id | user | created_at | updated_at | author_association | body | reactions | performed_via_github_app | issue |
---|---|---|---|---|---|---|---|---|---|---|---|
https://github.com/pydata/xarray/issues/657#issuecomment-157413923 | https://api.github.com/repos/pydata/xarray/issues/657 | 157413923 | MDEyOklzc3VlQ29tbWVudDE1NzQxMzkyMw== | 10050469 | 2015-11-17T16:02:10Z | 2015-11-17T16:02:10Z | MEMBER | Hi again, I've made a self-contained example below. I have no clue about how cartopy works (blind xray user, sorry :-() and was not able to remove the dependency to xray without getting different plots for imshow() and pcolormesh()... If one of the xray gurus could help me to remove the xray part of the code I could open an issue in cartopy. I wonder if the problem comes from the fact that ERA-Interim lons are spanning 0-360? ``` python import matplotlib.pyplot as plt import xray import numpy as np import cartopy.crs as ccrs import time nlats, nlons = (241, 480) lats = np.linspace(90, -90, nlats) lons = np.linspace(0, 360-0.75, nlons) l1, l2 = np.meshgrid(lons, lats) data = xray.DataArray(l1 + l2, [('latitude', lats), ('longitude', lons)]) start_time = time.time() fig = plt.figure() ax = plt.axes(projection=ccrs.Robinson()) data.plot.imshow(ax=ax, transform=ccrs.PlateCarree()) ax.coastlines() plt.savefig('imshow.png') print("imshow: {:.2f} s".format(time.time() - start_time)) start_time = time.time() fig = plt.figure() ax = plt.axes(projection=ccrs.Robinson()) data.plot.pcolormesh(ax=ax, transform=ccrs.PlateCarree()) ax.coastlines() plt.savefig('pcolormesh.png') print("pcolormesh: {:.2f} s".format(time.time() - start_time)) ``` imshow: 3.09 s pcolormesh: 27.53 s |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
117002929 |