Skip to content

Commit e6d45ec

Browse files
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
1 parent 862bd77 commit e6d45ec

6 files changed

+93
-1
lines changed
+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
"""
2+
Cylindrical equal-area
3+
======================
4+
5+
``Ylon0/lat0/width``: Give central meridian ``lon0``, the standard parallel ``lat0``, and the figure ``width``.
6+
"""
7+
import pygmt
8+
9+
fig = pygmt.Figure()
10+
# Use region "d" to specify global region (-180/180/-90/90)
11+
fig.coast(
12+
region="d",
13+
projection="Y35/30/12c",
14+
water="dodgerblue",
15+
shorelines="thinnest",
16+
frame="afg",
17+
)
18+
fig.show()
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
"""
2+
Cylindrical equidistant
3+
=======================
4+
5+
``Qwidth``: Give the figure ``width``.
6+
"""
7+
import pygmt
8+
9+
fig = pygmt.Figure()
10+
# Use region "d" to specify global region (-180/180/-90/90)
11+
fig.coast(
12+
region="d",
13+
projection="Q12c",
14+
land="tan4",
15+
water="lightcyan",
16+
frame="afg",
17+
)
18+
fig.show()

examples/projections/cyl/cyl_mercator.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@
88
import pygmt
99

1010
fig = pygmt.Figure()
11-
fig.coast(region=[0, 360, -80, 80], frame="afg", land="gray", projection="M0/0/8i")
11+
fig.coast(region=[0, 360, -80, 80], frame="afg", land="red", projection="M0/0/12c")
1212
fig.show()
+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
"""
2+
Miller cylindrical
3+
==================
4+
5+
``J[lon0/]width``: Give the optional central meridian ``lon0`` and the figure ``width``.
6+
"""
7+
import pygmt
8+
9+
fig = pygmt.Figure()
10+
fig.coast(
11+
region=[-180, 180, -80, 80],
12+
projection="J-65/12c",
13+
land="khaki",
14+
water="azure",
15+
shorelines="thinnest",
16+
frame="afg",
17+
)
18+
fig.show()
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
"""
2+
Transverse Mercator
3+
===================
4+
5+
``T[lon0/][lat0/]width``: Give central meridian ``lon0``, the latitude of the
6+
origin ``lat0`` (optional), and the figure width.
7+
"""
8+
import pygmt
9+
10+
fig = pygmt.Figure()
11+
fig.coast(
12+
region=[20, 50, 30, 45],
13+
projection="T35/12c",
14+
land="lightbrown",
15+
water="seashell",
16+
shorelines="thinnest",
17+
frame="afg",
18+
)
19+
fig.show()
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
"""
2+
Universal Transverse Mercator
3+
=============================
4+
5+
``U[UTM Zone/][lat0/]width``: Give UTM Zone ``UTM Zone``, and the figure width.
6+
"""
7+
import pygmt
8+
9+
fig = pygmt.Figure()
10+
# UTM Zone is set to 52R
11+
fig.coast(
12+
region=[127.5, 128.5, 26, 27],
13+
projection="U52R/12c",
14+
land="lightgreen",
15+
water="lightblue",
16+
shorelines="thinnest",
17+
frame="afg",
18+
)
19+
fig.show()

0 commit comments

Comments
 (0)