Skip to content

Commit

Permalink
DOC/projections: Make example design consistent (#3464)
Browse files Browse the repository at this point in the history
  • Loading branch information
yvonnefroehlich authored Sep 30, 2024
1 parent f14aac5 commit 9ddd91e
Show file tree
Hide file tree
Showing 31 changed files with 132 additions and 97 deletions.
4 changes: 3 additions & 1 deletion examples/projections/azim/azim_equidistant.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,7 @@
import pygmt

fig = pygmt.Figure()
fig.coast(projection="E-100/40/15c", region="g", frame="g", land="gray")
fig.coast(
region="g", projection="E-100/40/15c", frame="afg", land="khaki", water="white"
)
fig.show()
7 changes: 4 additions & 3 deletions examples/projections/azim/azim_general_perspective.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,10 @@

fig = pygmt.Figure()
fig.coast(
projection="G4/52/12c+a30+t45+v60/60+w0+z250",
region="g",
frame=["x10g10", "y5g5"],
land="gray",
projection="G4/52/12c+a30+t45+v60/60+w0+z250",
frame="afg",
land="khaki",
water="white",
)
fig.show()
8 changes: 7 additions & 1 deletion examples/projections/azim/azim_general_stereographic.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,11 @@
import pygmt

fig = pygmt.Figure()
fig.coast(region=[4, 14, 52, 57], projection="S0/90/12c", frame="ag", land="gray")
fig.coast(
region=[4, 14, 52, 57],
projection="S0/90/12c",
frame="afg",
land="khaki",
water="white",
)
fig.show()
8 changes: 7 additions & 1 deletion examples/projections/azim/azim_gnomonic.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,11 @@
import pygmt

fig = pygmt.Figure()
fig.coast(projection="F-90/15/12c", region="g", frame="20g20", land="gray")
fig.coast(
region="g",
projection="F-90/15/12c",
frame="afg",
land="khaki",
water="white",
)
fig.show()
8 changes: 7 additions & 1 deletion examples/projections/azim/azim_lambert.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,11 @@
import pygmt

fig = pygmt.Figure()
fig.coast(region="g", frame="afg", land="gray", projection="A30/-20/60/12c")
fig.coast(
region="g",
projection="A30/-20/60/12c",
frame="afg",
land="khaki",
water="white",
)
fig.show()
8 changes: 7 additions & 1 deletion examples/projections/azim/azim_orthographic.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,11 @@
import pygmt

fig = pygmt.Figure()
fig.coast(projection="G10/52/12c", region="g", frame="g", land="gray")
fig.coast(
region="g",
projection="G10/52/12c",
frame="afg",
land="khaki",
water="white",
)
fig.show()
6 changes: 5 additions & 1 deletion examples/projections/conic/conic_albers.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@
fig = pygmt.Figure()
# Use the ISO country code for Brazil and add a padding of 2 degrees (+R2)
fig.coast(
projection="B-55/-15/-25/0/12c", region="BR+R2", frame="afg", land="gray", borders=1
region="BR+R2",
projection="B-55/-15/-25/0/12c",
frame="afg",
land="seagreen",
water="gray90",
)
fig.show()
5 changes: 2 additions & 3 deletions examples/projections/conic/conic_equidistant.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,10 @@

fig = pygmt.Figure()
fig.coast(
shorelines="1/0.5p",
region=[-88, -70, 18, 24],
projection="D-79/21/19/23/12c",
land="lightgreen",
water="lightblue",
frame="afg",
land="seagreen",
water="gray90",
)
fig.show()
5 changes: 2 additions & 3 deletions examples/projections/conic/conic_lambert.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,11 @@

fig = pygmt.Figure()
fig.coast(
shorelines="1/0.5p",
region=[-130, -70, 24, 52],
projection="L-100/35/33/45/12c",
land="gray",
borders=["1/thick,black", "2/thin,black"],
frame="afg",
land="seagreen",
water="gray90",
)

fig.show()
8 changes: 3 additions & 5 deletions examples/projections/conic/polyconic.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,10 @@

fig = pygmt.Figure()
fig.coast(
shorelines="1/0.5p",
region=[-180, -20, 0, 90],
projection="Poly/12c",
land="gray",
borders="1/thick,black",
frame="afg10",
frame="afg",
land="seagreen",
water="gray90",
)

fig.show()
8 changes: 7 additions & 1 deletion examples/projections/cyl/cyl_cassini.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,11 @@

fig = pygmt.Figure()
# Use the ISO code for Madagascar (MG) and pad it by 2 degrees (+R2)
fig.coast(projection="C47/-19/12c", region="MG+R2", frame="afg", land="gray", borders=1)
fig.coast(
region="MG+R2",
projection="C47/-19/12c",
frame="afg",
land="gray80",
water="steelblue",
)
fig.show()
4 changes: 2 additions & 2 deletions examples/projections/cyl/cyl_equal_area.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
fig.coast(
region="d",
projection="Y35/30/12c",
water="dodgerblue",
shorelines="thinnest",
frame="afg",
land="gray80",
water="steelblue",
)
fig.show()
4 changes: 2 additions & 2 deletions examples/projections/cyl/cyl_equidistant.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
fig.coast(
region="d",
projection="Q12c",
land="tan4",
water="lightcyan",
frame="afg",
land="gray80",
water="steelblue",
)
fig.show()
8 changes: 7 additions & 1 deletion examples/projections/cyl/cyl_mercator.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,11 @@
import pygmt

fig = pygmt.Figure()
fig.coast(region=[0, 360, -80, 80], frame="afg", land="red", projection="M0/0/12c")
fig.coast(
region=[0, 360, -80, 80],
projection="M0/0/12c",
frame="afg",
land="gray80",
water="steelblue",
)
fig.show()
5 changes: 2 additions & 3 deletions examples/projections/cyl/cyl_miller.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,8 @@
fig.coast(
region=[-180, 180, -80, 80],
projection="J-65/12c",
land="khaki",
water="azure",
shorelines="thinnest",
frame="afg",
land="gray80",
water="steelblue",
)
fig.show()
15 changes: 12 additions & 3 deletions examples/projections/cyl/cyl_oblique_mercator.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@
# Set bottom left and top right coordinates of the figure with "+r"
region="-122/35/-107/22+r",
frame="afg",
land="gray",
land="gray80",
water="steelblue",
)
fig.show()

Expand All @@ -47,7 +48,11 @@

fig = pygmt.Figure()
fig.coast(
projection="Ob130/35/25/35/3c", region="130/35/145/40+r", frame="afg", land="gray"
projection="Ob130/35/25/35/3c",
region="130/35/145/40+r",
frame="afg",
land="gray80",
water="steelblue",
)
fig.show()

Expand All @@ -63,7 +68,11 @@

fig = pygmt.Figure()
fig.coast(
projection="Oc280/25.5/22/69/4c", region="270/20/305/25+r", frame="afg", land="gray"
projection="Oc280/25.5/22/69/4c",
region="270/20/305/25+r",
frame="afg",
land="gray80",
water="steelblue",
)
fig.show()

Expand Down
8 changes: 7 additions & 1 deletion examples/projections/cyl/cyl_stereographic.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,11 @@
import pygmt

fig = pygmt.Figure()
fig.coast(region="g", frame="afg", land="gray", projection="Cyl_stere/30/-20/12c")
fig.coast(
region="g",
projection="Cyl_stere/30/-20/12c",
frame="afg",
land="gray80",
water="steelblue",
)
fig.show()
5 changes: 2 additions & 3 deletions examples/projections/cyl/cyl_transverse_mercator.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,8 @@
fig.coast(
region=[20, 50, 30, 45],
projection="T35/12c",
land="lightbrown",
water="seashell",
shorelines="thinnest",
frame="afg",
land="gray80",
water="steelblue",
)
fig.show()
5 changes: 2 additions & 3 deletions examples/projections/cyl/cyl_universal_transverse_mercator.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,8 @@
fig.coast(
region=[127.5, 128.5, 26, 27],
projection="U52R/12c",
land="lightgreen",
water="lightblue",
shorelines="thinnest",
frame="afg",
land="gray80",
water="steelblue",
)
fig.show()
2 changes: 1 addition & 1 deletion examples/projections/misc/misc_eckertIV.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@

fig = pygmt.Figure()
# Use region "d" to specify global region (-180/180/-90/90)
fig.coast(region="d", projection="Kf12c", land="ivory", water="bisque4", frame="afg")
fig.coast(region="d", projection="Kf12c", frame="afg", land="ivory", water="bisque4")
fig.show()
2 changes: 1 addition & 1 deletion examples/projections/misc/misc_eckertVI.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@

fig = pygmt.Figure()
# Use region "d" to specify global region (-180/180/-90/90)
fig.coast(region="d", projection="Ks12c", land="ivory", water="bisque4", frame="afg")
fig.coast(region="d", projection="Ks12c", frame="afg", land="ivory", water="bisque4")
fig.show()
2 changes: 1 addition & 1 deletion examples/projections/misc/misc_hammer.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@

fig = pygmt.Figure()
# Use region "d" to specify global region (-180/180/-90/90)
fig.coast(region="d", projection="H12c", land="black", water="cornsilk", frame="afg")
fig.coast(region="d", projection="H12c", frame="afg", land="ivory", water="bisque4")
fig.show()
2 changes: 1 addition & 1 deletion examples/projections/misc/misc_mollweide.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@

fig = pygmt.Figure()
# Use region "d" to specify global region (-180/180/-90/90)
fig.coast(region="d", projection="W12c", land="tomato1", water="skyblue", frame="ag")
fig.coast(region="d", projection="W12c", frame="afg", land="ivory", water="bisque4")
fig.show()
2 changes: 1 addition & 1 deletion examples/projections/misc/misc_robinson.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,5 @@

fig = pygmt.Figure()
# Use region "d" to specify global region (-180/180/-90/90)
fig.coast(region="d", projection="N12c", land="goldenrod", water="snow2", frame="afg")
fig.coast(region="d", projection="N12c", frame="afg", land="ivory", water="bisque4")
fig.show()
2 changes: 1 addition & 1 deletion examples/projections/misc/misc_sinusoidal.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@

fig = pygmt.Figure()
# Use region "d" to specify global region (-180/180/-90/90)
fig.coast(region="d", projection="I12c", land="coral4", water="azure3", frame="afg")
fig.coast(region="d", projection="I12c", frame="afg", land="ivory", water="bisque4")
fig.show()
2 changes: 1 addition & 1 deletion examples/projections/misc/misc_van_der_grinten.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@

fig = pygmt.Figure()
# Use region "d" to specify global region (-180/180/-90/90)
fig.coast(region="d", projection="V12c", land="gray", water="cornsilk", frame="afg")
fig.coast(region="d", projection="V12c", frame="afg", land="ivory", water="bisque4")
fig.show()
2 changes: 1 addition & 1 deletion examples/projections/misc/misc_winkel_tripel.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,5 @@

fig = pygmt.Figure()
# Use region "d" to specify global region (-180/180/-90/90)
fig.coast(region="d", projection="R12c", land="burlywood4", water="wheat1", frame="afg")
fig.coast(region="d", projection="R12c", frame="afg", land="ivory", water="bisque4")
fig.show()
19 changes: 6 additions & 13 deletions examples/projections/nongeo/cartesian_linear.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,10 @@
import pygmt

fig = pygmt.Figure()
fig.plot(
# The x and y parameters determine the coordinates of lines
x=[3, 9, 2],
y=[4, 9, 37],
pen="3p,red",
# The region parameter sets the x and y ranges of the
# Cartesian projection
region=[0, 10, 0, 50],
projection="X15c/10c",
# "WSne" is passed to the frame parameter to put annotations
# only on the left and bottom axes
frame=["af", "WSne"],
)
# The region parameter is specified as x_min, x_max, y_min, y_max
fig.basemap(region=[0, 10, 0, 50], projection="X15c/10c", frame=["afg", "+gbisque"])
fig.plot(x=[3, 9, 2], y=[4, 9, 37], pen="2p,black")
# Plot data points ontop of the line
# Use squares with a size of 0.3 centimeters, an "orange" fill and a "black" outline
fig.plot(x=[3, 9, 2], y=[4, 9, 37], style="s0.3c", fill="orange", pen="black")
fig.show()
19 changes: 9 additions & 10 deletions examples/projections/nongeo/cartesian_logarithmic.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,21 +26,20 @@
ypoints = xpoints**0.5

fig = pygmt.Figure()
fig.plot(
fig.basemap(
region=[1, 100, 0, 10],
# Set a logarithmic transformation on the x-axis
projection="X15cl/10c",
# Set the figures frame and color as well as
# annotations, ticks, and gridlines
frame=["WSne+gbisque", "xa2g3", "ya2f1g2"],
x=xline,
y=yline,
# Set the line thickness to "1p", the color to "blue",
# and the style to "-", i.e. "dashed"
pen="1p,blue,-",
)
# Plot square root values as points on the line
# Style of points is 0.3 cm squares, color fill is "red" with a "black" outline
# Points are not clipped if they go off the figure
fig.plot(x=xpoints, y=ypoints, style="s0.3c", fill="red", no_clip=True, pen="black")

# Set the line thickness to "2p", the color to "black", and the style to "dashed"
fig.plot(x=xline, y=yline, pen="2p,black,dashed")

# Plot the square root values ontop of the line
# Use squares with a size of 0.3 centimeters, an "orange" fill and a "black" outline
# Symbols are not clipped if they go off the figure
fig.plot(x=xpoints, y=ypoints, style="s0.3c", fill="orange", pen="black", no_clip=True)
fig.show()
Loading

0 comments on commit 9ddd91e

Please sign in to comment.