Skip to content

Commit

Permalink
Adding cylindrical projections to gallery (#727)
Browse files Browse the repository at this point in the history
* Add cyl_transverse_mercator.py
* Add cyl_universal_transverse_mercator.py
* Changing land color to red in cyl_mercator.py to match GMT docs example; changing units from US to SI
* Add cyl_equidistant.py
* Add cyl_equal_area.py
* Add cyl_miller.py
  • Loading branch information
willschlitzer authored Dec 13, 2020
1 parent 862bd77 commit e6d45ec
Show file tree
Hide file tree
Showing 6 changed files with 93 additions and 1 deletion.
18 changes: 18 additions & 0 deletions examples/projections/cyl/cyl_equal_area.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
"""
Cylindrical equal-area
======================
``Ylon0/lat0/width``: Give central meridian ``lon0``, the standard parallel ``lat0``, and the figure ``width``.
"""
import pygmt

fig = pygmt.Figure()
# Use region "d" to specify global region (-180/180/-90/90)
fig.coast(
region="d",
projection="Y35/30/12c",
water="dodgerblue",
shorelines="thinnest",
frame="afg",
)
fig.show()
18 changes: 18 additions & 0 deletions examples/projections/cyl/cyl_equidistant.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
"""
Cylindrical equidistant
=======================
``Qwidth``: Give the figure ``width``.
"""
import pygmt

fig = pygmt.Figure()
# Use region "d" to specify global region (-180/180/-90/90)
fig.coast(
region="d",
projection="Q12c",
land="tan4",
water="lightcyan",
frame="afg",
)
fig.show()
2 changes: 1 addition & 1 deletion examples/projections/cyl/cyl_mercator.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@
import pygmt

fig = pygmt.Figure()
fig.coast(region=[0, 360, -80, 80], frame="afg", land="gray", projection="M0/0/8i")
fig.coast(region=[0, 360, -80, 80], frame="afg", land="red", projection="M0/0/12c")
fig.show()
18 changes: 18 additions & 0 deletions examples/projections/cyl/cyl_miller.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
"""
Miller cylindrical
==================
``J[lon0/]width``: Give the optional central meridian ``lon0`` and the figure ``width``.
"""
import pygmt

fig = pygmt.Figure()
fig.coast(
region=[-180, 180, -80, 80],
projection="J-65/12c",
land="khaki",
water="azure",
shorelines="thinnest",
frame="afg",
)
fig.show()
19 changes: 19 additions & 0 deletions examples/projections/cyl/cyl_transverse_mercator.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
"""
Transverse Mercator
===================
``T[lon0/][lat0/]width``: Give central meridian ``lon0``, the latitude of the
origin ``lat0`` (optional), and the figure width.
"""
import pygmt

fig = pygmt.Figure()
fig.coast(
region=[20, 50, 30, 45],
projection="T35/12c",
land="lightbrown",
water="seashell",
shorelines="thinnest",
frame="afg",
)
fig.show()
19 changes: 19 additions & 0 deletions examples/projections/cyl/cyl_universal_transverse_mercator.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
"""
Universal Transverse Mercator
=============================
``U[UTM Zone/][lat0/]width``: Give UTM Zone ``UTM Zone``, and the figure width.
"""
import pygmt

fig = pygmt.Figure()
# UTM Zone is set to 52R
fig.coast(
region=[127.5, 128.5, 26, 27],
projection="U52R/12c",
land="lightgreen",
water="lightblue",
shorelines="thinnest",
frame="afg",
)
fig.show()

0 comments on commit e6d45ec

Please sign in to comment.