Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions docs/projections.py
Original file line number Diff line number Diff line change
Expand Up @@ -515,6 +515,36 @@
)


# %% [raw] raw_mimetype="text/restructuredtext"
# .. note:: Cartopy gridline label placement
#
# With the Cartopy backend, UltraPlot uses Cartopy's gridliner to position
# geographic labels. Cartopy can hide labels that would overlap; UltraPlot
# enables this by default through :rcraw:`grid.checkoverlap`. Therefore, a
# missing longitude label does not necessarily mean its meridian is misplaced.
#
# To keep *all* labels, set ``uplt.rc["grid.checkoverlap"] = False`` before
# drawing the figure. This setting is checked at draw time and applies to
# all Cartopy axes drawn while it is active. Alternatively, use
# `lonlocator`, `latlocator`, `lonformatter`, or `latformatter` with
# :meth:`~ultraplot.axes.GeoAxes.format` to override the label density or
# formatting on individual axes. The two maps below have the same extent:
# the left has densely spaced meridians (some labels may be omitted), and
# the right uses an explicit, sparser locator.
#
# %%
import ultraplot as uplt

fig, axs = uplt.subplots(
ncols=2, proj="cyl", proj_kw={"lon0": 180}, refwidth=2.7, share=0
)
axs.format(
lonlim=(70, 220), latlim=(-30, 60), coast=True, lonlabels=True, lonlocator=20
)
axs[0].format(title="Cartopy: automatic overlap check")
axs[1].format(title="UltraPlot: sparser labels", lonlocator=40)


# %% [raw] raw_mimetype="text/restructuredtext"
# .. _ug_geo_layout:
#
Expand Down
Loading