Skip to content

Gridlines are drawn without showing ticks. #2520

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
Curallin opened this issue Apr 15, 2025 · 2 comments
Open

Gridlines are drawn without showing ticks. #2520

Curallin opened this issue Apr 15, 2025 · 2 comments

Comments

@Curallin
Copy link

I often use ax.gridlines() to add coords info,but I can't make ticks shown like the figure below.

Image

Is it possible to adjust the following code to add axis ticks?

import cartopy.crs as ccrs
import matplotlib.pyplot as plt

fig,ax = plt.subplots(1,1,subplot_kw={'projection':ccrs.PlateCarree()})
ax.coastlines()
ax.set_global()
ax.stock_img()
ax.gridlines(draw_labels=True)

Image

@rcomer
Copy link
Member

rcomer commented Apr 16, 2025

For rectangular projections, you can go ahead and use Matplotlib’s x- and y-ticks instead of the Gridliner.
https://scitools.org.uk/cartopy/docs/latest/gallery/gridlines_and_labels/tick_labels.html#sphx-glr-gallery-gridlines-and-labels-tick-labels-py

@Curallin
Copy link
Author

@rcomer Thanks.It would be nice if Gridliner had improvements in the future in terms of the ticker being displayed .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants