From e6d45ecef0a8b1646517342cb084e90c23107008 Mon Sep 17 00:00:00 2001 From: Will Schlitzer Date: Sun, 13 Dec 2020 16:01:51 +0000 Subject: [PATCH] Adding cylindrical projections to gallery (#727) * 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 --- examples/projections/cyl/cyl_equal_area.py | 18 ++++++++++++++++++ examples/projections/cyl/cyl_equidistant.py | 18 ++++++++++++++++++ examples/projections/cyl/cyl_mercator.py | 2 +- examples/projections/cyl/cyl_miller.py | 18 ++++++++++++++++++ .../cyl/cyl_transverse_mercator.py | 19 +++++++++++++++++++ .../cyl/cyl_universal_transverse_mercator.py | 19 +++++++++++++++++++ 6 files changed, 93 insertions(+), 1 deletion(-) create mode 100644 examples/projections/cyl/cyl_equal_area.py create mode 100644 examples/projections/cyl/cyl_equidistant.py create mode 100644 examples/projections/cyl/cyl_miller.py create mode 100644 examples/projections/cyl/cyl_transverse_mercator.py create mode 100644 examples/projections/cyl/cyl_universal_transverse_mercator.py diff --git a/examples/projections/cyl/cyl_equal_area.py b/examples/projections/cyl/cyl_equal_area.py new file mode 100644 index 00000000000..33a729a2884 --- /dev/null +++ b/examples/projections/cyl/cyl_equal_area.py @@ -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() diff --git a/examples/projections/cyl/cyl_equidistant.py b/examples/projections/cyl/cyl_equidistant.py new file mode 100644 index 00000000000..3b548987503 --- /dev/null +++ b/examples/projections/cyl/cyl_equidistant.py @@ -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() diff --git a/examples/projections/cyl/cyl_mercator.py b/examples/projections/cyl/cyl_mercator.py index d2e54886e6f..bfe22ba87a9 100644 --- a/examples/projections/cyl/cyl_mercator.py +++ b/examples/projections/cyl/cyl_mercator.py @@ -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() diff --git a/examples/projections/cyl/cyl_miller.py b/examples/projections/cyl/cyl_miller.py new file mode 100644 index 00000000000..b25249a98d5 --- /dev/null +++ b/examples/projections/cyl/cyl_miller.py @@ -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() diff --git a/examples/projections/cyl/cyl_transverse_mercator.py b/examples/projections/cyl/cyl_transverse_mercator.py new file mode 100644 index 00000000000..fc8bb2198b9 --- /dev/null +++ b/examples/projections/cyl/cyl_transverse_mercator.py @@ -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() diff --git a/examples/projections/cyl/cyl_universal_transverse_mercator.py b/examples/projections/cyl/cyl_universal_transverse_mercator.py new file mode 100644 index 00000000000..47259c5bd6c --- /dev/null +++ b/examples/projections/cyl/cyl_universal_transverse_mercator.py @@ -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()