diff --git a/examples/gallery/maps/epsg_codes.py b/examples/gallery/maps/epsg_codes.py new file mode 100644 index 00000000000..b1786c981e8 --- /dev/null +++ b/examples/gallery/maps/epsg_codes.py @@ -0,0 +1,23 @@ +""" +EPSG codes +========== + +Besides one of the :doc:`31 projections supported by GMT `, users +can pass an EPSG (European Petroleum Survey Group) code to the ``projection`` parameter. +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 and +https://spatialreference.org/. Please note, that not all EPSG codes are supported by +GMT / PyGMT. +""" + +# %% +import pygmt + +fig = pygmt.Figure() + +# Pass the desired EPSG code and the width of the map (separated by a slash) to the +# projection parameter +fig.basemap(region=[-180, 180, -60, 60], projection="EPSG:3857/10c", frame=30) +fig.coast(land="gray", shorelines="1/0.1p,gray10") + +fig.show()