Skip to content

Improve example for Polar projection #2110

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 19 commits into from
Oct 30, 2022
Merged
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
6a6b81d
Add description of subplots - position of subplot
yvonnefroehlich Sep 3, 2022
4e72926
Set titles via '+t' modifier of 'frame' parameter (not via text method)
yvonnefroehlich Sep 3, 2022
990f0ed
Add explanation for line break within title
yvonnefroehlich Sep 3, 2022
32a0e7e
Adjust explanation of agrument for 'frame' parameter
yvonnefroehlich Sep 3, 2022
4e4738d
Adjust length of argument for 'frame' parameter
yvonnefroehlich Sep 3, 2022
d5247ac
Add explantion for line break within title to every subplot
yvonnefroehlich Sep 3, 2022
83aae33
[format-command] fixes
actions-bot Sep 3, 2022
0aa59f9
Remove line breaks
yvonnefroehlich Sep 3, 2022
4b4a539
Merge branch 'main' into improve-polar-proj-example
yvonnefroehlich Sep 7, 2022
b9e2d8d
Use 'noqa:W605' to allow for escape sequence '\z'
yvonnefroehlich Sep 14, 2022
e555ab1
Merge branch 'main' into improve-polar-proj-example
yvonnefroehlich Sep 14, 2022
2cddd66
Use '\\' instead of 'noqa:W605' to allow for escape sequence '\z' (co…
yvonnefroehlich Sep 17, 2022
e9e0b27
Merge branch 'main' into improve-polar-proj-example
yvonnefroehlich Sep 20, 2022
ad2106b
Merge branch 'main' into improve-polar-proj-example
yvonnefroehlich Oct 4, 2022
4e528ca
Merge branch 'main' into improve-polar-proj-example
yvonnefroehlich Oct 17, 2022
fce57ee
Use monospaced font for titles (code review)
yvonnefroehlich Oct 28, 2022
676f2d9
Remove empty lines
yvonnefroehlich Oct 28, 2022
21ca748
Use consistently lower-case letters
yvonnefroehlich Oct 28, 2022
e3b9587
Merge branch 'main' into improve-polar-proj-example
yvonnefroehlich Oct 28, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
75 changes: 37 additions & 38 deletions examples/projections/nongeo/polar.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,60 +52,57 @@

fig = pygmt.Figure()

pygmt.config(FONT_TITLE="14p,Helvetica,black", FORMAT_GEO_MAP="+D")
pygmt.config(FONT_TITLE="14p,Courier,black", FORMAT_GEO_MAP="+D")

# ============

# top left
fig.basemap(
# set map limits to theta_min = 0, theta_max = 360, radius_min = 0,
# radius_max = 1
region=[0, 360, 0, 1],
# set map width to 5 cm
projection="P5c",
# set the frame and color
frame=["xa45f", "+gbisque"],
# set the frame, color, and title
# @^ allows for a line break within the title
frame=["xa45f", "+gbisque+tprojection='P5c' @^ region=[0, 360, 0, 1]"],
)

fig.text(position="TC", text="projection='P5c'", offset="0/2.0c", no_clip=True)
fig.text(position="TC", text="region=[0, 360, 0, 1]", offset="0/1.5c", no_clip=True)

fig.shift_origin(xshift="8c")

# ============
# top middle
fig.basemap(
# set map limits to theta_min = 0, theta_max = 360, radius_min = 0,
# radius_max = 1
region=[0, 360, 0, 1],
# set map width to 5 cm and interpret input data as geographic azimuth
# instead of standard angle
projection="P5c+a",
# set the frame and color
frame=["xa45f", "+gbisque"],
# set the frame, color, and title
# @^ allows for a line break within the title
frame=["xa45f", "+gbisque+tprojection='P5c+a' @^ region=[0, 360, 0, 1]"],
)

fig.text(position="TC", text="projection='P5c+a'", offset="0/2.0c", no_clip=True)
fig.text(position="TC", text="region=[0, 360, 0, 1]", offset="0/1.5c", no_clip=True)

fig.shift_origin(xshift="8c")

# ============
# top right
fig.basemap(
# set map limits to theta_min = 0, theta_max = 90, radius_min = 0,
# radius_max = 1
region=[0, 90, 0, 1],
# set map width to 5 cm and interpret input data as geographic azimuth
# instead of standard angle
projection="P5c+a",
# set the frame and color
frame=["xa45f", "ya0.2", "WNe+gbisque"],
# set the frame, color, and title
# @^ allows for a line break within the title
frame=["xa45f", "ya0.2", "WNe+gbisque+tprojection='P5c+a' @^ region=[0, 90, 0, 1]"],
)

fig.text(position="TC", text="projection='P5c+a'", offset="0/2.0c", no_clip=True)
fig.text(position="TC", text="region=[0, 90, 0, 1]", offset="0/1.5c", no_clip=True)

fig.shift_origin(xshift="-16c", yshift="-7c")

# ============
# bottom left
fig.basemap(
# set map limits to theta_min = 0, theta_max = 90, radius_min = 0,
# radius_max = 1
Expand All @@ -114,16 +111,19 @@
# instead of standard angle, rotate coordinate system counterclockwise by
# 45 degrees
projection="P5c+a+t45",
# set the frame and color
frame=["xa30f", "ya0.2", "WNe+gbisque"],
# set the frame, color, and title
# @^ allows for a line break within the title
frame=[
"xa30f",
"ya0.2",
"WNe+gbisque+tprojection='P5c+a+t45' @^ region=[0, 90, 0, 1]",
],
)

fig.text(position="TC", text=r"projection='P5c+a\+t45'", offset="0/2.0c", no_clip=True)
fig.text(position="TC", text="region=[0, 90, 0, 1]", offset="0/1.5c", no_clip=True)

fig.shift_origin(xshift="8c", yshift="1.3c")

# ============
# bottom middle
fig.basemap(
# set map limits to theta_min = 0, theta_max = 90, radius_min = 3480,
# radius_max = 6371 (Earth's radius)
Expand All @@ -132,18 +132,19 @@
# instead of standard angle, rotate coordinate system counterclockwise by
# 45 degrees
projection="P5c+a+t45",
# set the frame and color
frame=["xa30f", "ya", "WNse+gbisque"],
)

fig.text(position="TC", text=r"projection='P5c+a\+t45'", offset="0/2.0c", no_clip=True)
fig.text(
position="TC", text="region=[0, 90, 3480, 6371]", offset="0/1.5c", no_clip=True
# set the frame, color, and title
# @^ allows for a line break within the title
frame=[
"xa30f",
"ya",
"WNse+gbisque+tprojection='P5c+a+t45' @^ region=[0, 90, 3480, 6371]",
],
)

fig.shift_origin(xshift="8c")

# ============
# bottom right
fig.basemap(
# set map limits to theta_min = 0, theta_max = 90, radius_min = 3480,
# radius_max = 6371 (Earth's radius)
Expand All @@ -152,15 +153,13 @@
# instead of standard angle, rotate coordinate system counterclockwise by
# 45 degrees, r-axis is marked as depth
projection="P5c+a+t45+z",
# set the frame and color
frame=["xa30f", "ya", "WNse+gbisque"],
)

fig.text(
position="TC", text=r"projection='P5c+a\+t45+z'", offset="0/2.0c", no_clip=True
)
fig.text(
position="TC", text="region=[0, 90, 3480, 6371]", offset="0/1.5c", no_clip=True
# set the frame, color, and title
# @^ allows for a line break within the title
frame=[
"xa30f",
"ya",
"WNse+gbisque+tprojection='P5c+a+t45+\\z' @^ region=[0, 90, 3480, 6371]",
],
)

fig.show()