Open
Description
Description
Currently, only grid_lines
is supported for geographic plots.
It would be useful to add the grid_ticks
for cleaner plot.
Steps to reproduce
import proplot as plot
fig, axs = plot.subplots(proj='cyl')
axs.format(land=True,
labels=True,
lonlines=20,
latlines=20,
gridminor=True,
lonlim=(-140, 60),
latlim=(-10, 50))
Expected behavior: [What you expected to happen]
Ticks without gridlines.
I found one example showing ticks with Gridlines:
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.ticker as mticker
import cartopy.crs as ccrs
from cartopy.mpl.ticker import LongitudeFormatter, LatitudeFormatter
dlon, dlat = 60, 30
xticks = np.arange(0, 360.1, dlon)
yticks = np.arange(-90, 90.1, dlat)
fig = plt.figure(figsize=(6,5))
ax = fig.add_subplot(1,1,1, projection=ccrs.PlateCarree(central_longitude=180))
ax.coastlines() #海岸线
gl = ax.gridlines(crs=ccrs.PlateCarree(), draw_labels=False,linewidth=1, linestyle=':', color='k', alpha=0.8)
gl.xlocator = mticker.FixedLocator(xticks)
gl.ylocator = mticker.FixedLocator(yticks)
ax.set_xticks(xticks, crs=ccrs.PlateCarree())
ax.set_yticks(yticks, crs=ccrs.PlateCarree())
ax.xaxis.set_major_formatter(LongitudeFormatter(zero_direction_label=True))
ax.yaxis.set_major_formatter(LatitudeFormatter())
Actual behavior: [What actually happened]
Can't let ticks show.
Proplot version
0.6.4