Skip to content

DOC: Add gallery example for using EPSG codes #3973

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

Draft
wants to merge 24 commits into
base: main
Choose a base branch
from
Draft
Changes from 4 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
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
23 changes: 23 additions & 0 deletions examples/gallery/maps/epsg_codes.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
"""
EPSG codes
==========

Besides one of the :doc:`31 projections supported by GMT </techref/projections>`, users
can pass an EPSG (European Petroleum Survey Group) code to the ``projection`` parameter
of the methods :meth:`Figure.basemap` and :meth:`Figure.coast`. A commonly used EPSG
code is ``EPSG:3857``, that refers to the Web Mercator projection WGS84. More
information on the EPSG dataset can be found at https://epsg.org/home.html.

"""

# %%
import pygmt

fig = pygmt.Figure()

# Pass the desired EPSG code and the width of the map, here 10 centimeters, to the
# projection parameter
fig.basemap(region=[-180, 180, -60, 60], projection="EPSG:3857/10c", frame="30")
fig.coast(shorelines="1/0.1p,gray10")

fig.show()
Loading