proplot
proplot copied to clipboard
Missing 180 degree label in 'npaeqd' projection
Description
When I set proj='npaeqd'
, proplot 0.9.7
does not show all longitude labels, but only far bottom label 0°
. This problem does not exists in 0.9.5.post332
.
import proplot as pplt
import numpy as np
fig, ax = pplt.subplots(ncols=2, nrows=2, proj='npaeqd', share=False)
ax.format(labels=True, coast=True,
lonlocator=np.arange(-180,180+30,30))
Steps to reproduce
import proplot as pplt
import numpy as np
fig, ax = pplt.subplots(ncols=2, nrows=2, proj='npaeqd', share=False)
ax.format(labels=True, coast=True,
lonlocator=np.arange(-180,180+30,30))
Expected behavior:
Â
show longitude labels as in proplot 0.9.5.post332
Â
Â
By the way, how can I make longitude labels like this as in cartopy? ( showing far top label 180°
compared to picture 2)
Â
import matplotlib.pyplot as plt
import cartopy.crs as ccrs
import matplotlib.path as mpath
import numpy as np
fig = plt.figure(figsize=[10, 5])
ax1 = fig.add_subplot(1, 2, 1, projection=ccrs.NorthPolarStereo())
leftlon, rightlon, lowerlat, upperlat = (-180,180,0,90)
ax1.set_extent([leftlon, rightlon, lowerlat, upperlat], ccrs.PlateCarree())
# add labels
ax1.gridlines(crs=ccrs.PlateCarree(), draw_labels=True,
xlocs = np.arange(-180,180+30,30),
linewidth=1, color='grey',linestyle='--')
# set the boundary
theta = np.linspace(0, 2*np.pi, 100)
center, radius = [0.5, 0.5], 0.5
verts = np.vstack([np.sin(theta), np.cos(theta)]).T
circle = mpath.Path(verts * radius + center)
ax1.set_boundary(circle, transform=ax1.transAxes)
 Actual behavior: Only showing the far bottom label as in picture 1.
Equivalent steps in matplotlib
import proplot as pplt
import numpy as np
fig, ax = pplt.subplots(ncols=2, nrows=2, proj='npaeqd',share=False)
ax.format(labels=True, coast=True,
lonlocator=np.arange(-180,180+30,30))
Proplot version
matplotlib 3.4.3 proplot 0.9.7 cartopy 0.20.2