Open aymeric-spiga opened 5 years ago
standalone example
#! /usr/bin/env python
#import ppplot
import numpy as np
b = np.arange(2048).reshape(32,64)
lon = np.linspace(-180,180,64)
lat = np.linspace(-90,90,32)
print(b.shape)
print(lon.shape)
print(lat.shape)
#ppplot.quickplot(b)
import cartopy.crs as ccrs
import matplotlib.pyplot as plt
prj = ccrs.Mollweide()
prj = ccrs.Orthographic(-10, 45)
#prj = ccrs.NorthPolarStereo()
ax = plt.axes(projection=prj)
#ax.set_xticks(range(-180,180,10), crs=ccrs.NorthPolarStereo())
#ax.set_yticks(range(-90,90,10), crs=ccrs.NorthPolarStereo())
ax.set_global()
#ax.gridlines()
ax.gridlines(draw_labels=True)
ax.contourf(lon,lat,b,transform=ccrs.PlateCarree())
plt.show()
Traceback (most recent call last):
File "./test.py", line 32, in
This might be solved soon? https://github.com/SciTools/cartopy/issues/881 https://github.com/SciTools/cartopy/pull/1089
The question is whether it is useful to do so, or if replacing planetoplot
by something based on xarray
is not a better solution see https://github.com/aymeric-spiga/planetoplot/issues/8
Looks like some progress is made in cartopy getting the labels like in matplotlib https://github.com/SciTools/cartopy/pull/1117
replace
basemap
bycartopy
proposed by @jbmadeleine