Skip to content

Commit eca2edd

Browse files
DOC/Projections "Polar": General improvements (#3634)
1 parent 476bf4c commit eca2edd

File tree

1 file changed

+54
-62
lines changed

1 file changed

+54
-62
lines changed

examples/projections/nongeo/polar.py

Lines changed: 54 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -2,50 +2,48 @@
22
Polar
33
=====
44
5-
Polar projections allow plotting polar coordinate data (e.g. angle
6-
:math:`\theta` and radius *r*).
5+
Polar projections allow plotting polar coordinate data (e.g. angle :math:`\theta` and
6+
radius *r*).
77
88
The full syntax for polar projections is:
99
1010
**P**\ *width*\ [**+a**]\ [**+f**\ [**e**\|\ **p**\|\ *radius*]]\
1111
[**+r**\ *offset*][**+t**\ *origin*][**+z**\ [**p**\|\ *radius*]]
1212
1313
Limits are set via the ``region`` parameter
14-
([*theta_min*, *theta_max*, *radius_min*, *radius_max*]). When using
15-
**P**\ *width* you have to give the *width* of the figure. The lower-case
16-
version **p** is similar to **P** but expects a *scale* instead of
17-
a width (**p**\ *scale*).
14+
([*theta_min*, *theta_max*, *radius_min*, *radius_max*]). When using **P**\ *width* you
15+
have to give the *width* of the figure. The lower-case version **p** is similar to **P**
16+
but expects a *scale* instead of a width (**p**\ *scale*).
1817
1918
The following customizing modifiers are available:
2019
21-
- **+a**: by default, :math:`\theta` refers to the angle that is equivalent to
22-
a counterclockwise rotation with respect to the east direction (standard
23-
definition); **+a** indicates that the input data are rotated clockwise
24-
relative to the north direction (geographical azimuth angle).
20+
- **+a**: by default, :math:`\theta` refers to the angle that is equivalent to a
21+
counterclockwise rotation with respect to the east direction (standard definition);
22+
**+a** indicates that the input data are rotated clockwise relative to the north
23+
direction (geographical azimuth angle).
2524
26-
- **+r**\ *offset*: represents the offset of the r-axis. This modifier allows
27-
you to offset the center of the circle from r=0.
25+
- **+r**\ *offset*: represents the offset of the r-axis. This modifier allows you to
26+
offset the center of the circle from r=0.
2827
2928
- **+t**\ *origin*: sets the angle corresponding to the east direction which is
30-
equivalent to rotating the entire coordinate axis clockwise; if the **+a**
31-
modifier is used, setting the angle corresponding to the north direction is
32-
equivalent to rotating the entire coordinate axis counterclockwise.
29+
equivalent to rotating the entire coordinate axis clockwise; if the **+a** modifier
30+
is used, setting the angle corresponding to the north direction is equivalent to
31+
rotating the entire coordinate axis counterclockwise.
3332
3433
- **+f**: reverses the radial direction.
3534
36-
- Append **e** to indicate that the r-axis is an elevation angle, and the
37-
range of the r-axis should be between 0° and 90°.
35+
- Append **e** to indicate that the r-axis is an elevation angle, and the range of the
36+
r-axis should be between 0° and 90°.
3837
- Appending **p** sets the current Earth radius (determined by
39-
:gmt-term:`PROJ_ELLIPSOID`)
40-
to the maximum value of the r-axis when the r-axis is reversed.
38+
:gmt-term:`PROJ_ELLIPSOID`) to the maximum value of the r-axis when the r-axis is
39+
reversed.
4140
- Append *radius* to set the maximum value of the r-axis.
4241
43-
- **+z**: indicates that the r-axis is marked as depth instead of radius (e.g.
42+
- **+z**: indicates that the r-axis is marked as depth instead of radius (e.g.,
4443
*r = radius - z*).
4544
4645
- Append **p** to set radius to the current Earth radius.
4746
- Append *radius* to set the value of the radius.
48-
4947
"""
5048

5149
# %%
@@ -56,100 +54,94 @@
5654
pygmt.config(FONT_TITLE="14p,Courier,black", FORMAT_GEO_MAP="+D")
5755

5856
# ============
59-
# top left
57+
# Top left
6058
fig.basemap(
61-
# set map limits to theta_min = 0, theta_max = 360, radius_min = 0,
62-
# radius_max = 1
59+
# Set map limits to theta_min = 0, theta_max = 360, radius_min = 0, radius_max = 1
6360
region=[0, 360, 0, 1],
64-
# set map width to 5 cm
61+
# Set map width to 5 cm
6562
projection="P5c",
66-
# set the frame and title; @^ allows for a line break within the title
63+
# Set the frame and title; @^ allows for a line break within the title
6764
frame=["xa45f", "+gbisque+tprojection='P5c' @^ region=[0, 360, 0, 1]"],
6865
)
6966

70-
fig.shift_origin(xshift="8c")
67+
fig.shift_origin(xshift="w+3c")
7168

7269
# ============
73-
# top middle
70+
# Top middle
7471
fig.basemap(
75-
# set map limits to theta_min = 0, theta_max = 360, radius_min = 0,
76-
# radius_max = 1
72+
# Set map limits to theta_min = 0, theta_max = 360, radius_min = 0, radius_max = 1
7773
region=[0, 360, 0, 1],
78-
# set map width to 5 cm and interpret input data as geographic azimuth
79-
# instead of standard angle
74+
# Set map width to 5 cm and interpret input data as geographic azimuth instead of
75+
# standard angle
8076
projection="P5c+a",
81-
# set the frame and title; @^ allows for a line break within the title
77+
# Set the frame and title; @^ allows for a line break within the title
8278
frame=["xa45f", "+gbisque+tprojection='P5c+a' @^ region=[0, 360, 0, 1]"],
8379
)
8480

85-
fig.shift_origin(xshift="8c")
81+
fig.shift_origin(xshift="w+3c")
8682

8783
# ============
88-
# top right
84+
# Top right
8985
fig.basemap(
90-
# set map limits to theta_min = 0, theta_max = 90, radius_min = 0,
91-
# radius_max = 1
86+
# Set map limits to theta_min = 0, theta_max = 90, radius_min = 0, radius_max = 1
9287
region=[0, 90, 0, 1],
93-
# set map width to 5 cm and interpret input data as geographic azimuth
94-
# instead of standard angle
88+
# Set map width to 5 cm and interpret input data as geographic azimuth instead of
89+
# standard angle
9590
projection="P5c+a",
96-
# set the frame and title; @^ allows for a line break within the title
91+
# Set the frame and title; @^ allows for a line break within the title
9792
frame=["xa45f", "ya0.2", "WNe+gbisque+tprojection='P5c+a' @^ region=[0, 90, 0, 1]"],
9893
)
9994

100-
fig.shift_origin(xshift="-16c", yshift="-7c")
95+
fig.shift_origin(xshift="-2w-6c", yshift="-h-2c")
10196

10297
# ============
103-
# bottom left
98+
# Bottom left
10499
fig.basemap(
105-
# set map limits to theta_min = 0, theta_max = 90, radius_min = 0,
106-
# radius_max = 1
100+
# Set map limits to theta_min = 0, theta_max = 90, radius_min = 0, radius_max = 1
107101
region=[0, 90, 0, 1],
108-
# set map width to 5 cm and interpret input data as geographic azimuth
109-
# instead of standard angle, rotate coordinate system counterclockwise by
110-
# 45 degrees
102+
# Set map width to 5 cm and interpret input data as geographic azimuth instead of
103+
# standard angle, rotate coordinate system counterclockwise by 45 degrees
111104
projection="P5c+a+t45",
112-
# set the frame and title; @^ allows for a line break within the title
105+
# Set the frame and title; @^ allows for a line break within the title
113106
frame=[
114107
"xa30f",
115108
"ya0.2",
116109
"WNe+gbisque+tprojection='P5c+a+t45' @^ region=[0, 90, 0, 1]",
117110
],
118111
)
119112

120-
fig.shift_origin(xshift="8c", yshift="1.3c")
113+
fig.shift_origin(xshift="w+3c", yshift="1.3c")
121114

122115
# ============
123-
# bottom middle
116+
# Bottom middle
124117
fig.basemap(
125-
# set map limits to theta_min = 0, theta_max = 90, radius_min = 3480,
118+
# Set map limits to theta_min = 0, theta_max = 90, radius_min = 3480,
126119
# radius_max = 6371 (Earth's radius)
127120
region=[0, 90, 3480, 6371],
128-
# set map width to 5 cm and interpret input data as geographic azimuth
129-
# instead of standard angle, rotate coordinate system counterclockwise by
130-
# 45 degrees
121+
# Set map width to 5 cm and interpret input data as geographic azimuth instead of
122+
# standard angle, rotate coordinate system counterclockwise by 45 degrees
131123
projection="P5c+a+t45",
132-
# set the frame, and title; @^ allows for a line break within the title
124+
# Set the frame, and title; @^ allows for a line break within the title
133125
frame=[
134126
"xa30f",
135127
"ya",
136128
"WNse+gbisque+tprojection='P5c+a+t45' @^ region=[0, 90, 3480, 6371]",
137129
],
138130
)
139131

140-
fig.shift_origin(xshift="8c")
132+
fig.shift_origin(xshift="w+3c")
141133

142134
# ============
143-
# bottom right
135+
# Bottom right
144136
fig.basemap(
145-
# set map limits to theta_min = 0, theta_max = 90, radius_min = 3480,
137+
# Set map limits to theta_min = 0, theta_max = 90, radius_min = 3480,
146138
# radius_max = 6371 (Earth's radius)
147139
region=[0, 90, 3480, 6371],
148-
# set map width to 5 cm and interpret input data as geographic azimuth
149-
# instead of standard angle, rotate coordinate system counterclockwise by
150-
# 45 degrees, r-axis is marked as depth
140+
# Set map width to 5 cm and interpret input data as geographic azimuth instead of
141+
# standard angle, rotate coordinate system counterclockwise by 45 degrees, r-axis
142+
# is marked as depth
151143
projection="P5c+a+t45+z",
152-
# set the frame, and title; @^ allows for a line break within the title
144+
# Set the frame, and title; @^ allows for a line break within the title
153145
frame=[
154146
"xa30f",
155147
"ya",

0 commit comments

Comments
 (0)