Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Yvonne Fröhlich <[email protected]>
Co-authored-by: Dongdong Tian <[email protected]>
  • Loading branch information
3 people authored Jan 13, 2025
1 parent 0717bf7 commit 8b020ce
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
22 changes: 11 additions & 11 deletions examples/gallery/lines/hlines_vlines.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,22 +64,22 @@
fig = pygmt.Figure()

fig.basemap(region="g", projection="R15c", frame=["+tGeographic hlines", "af"])
# Add a horizontal line at 70°N
# Add a line at 70°N
fig.hlines(y=70, pen="1.5p,red3", label="Line 1")
# Add a horizontal line at 50°N with longitude limits at 20°E and 160°E
# Add a line at 50°N with longitude limits at 20°E and 160°E
fig.hlines(y=50, xmin=20, xmax=160, pen="1.5p,dodgerblue3", label="Line 2")
# Add a horizontal line at 30°S with longitude limits at 60°E and 270°E
# Add a line at 30°S with longitude limits at 60°E and 270°E
fig.hlines(y=-30, xmin=60, xmax=270, pen="1.5p,gray30,-", label="Line 3")
fig.legend()

fig.shift_origin(xshift="w+2c")

fig.basemap(region="g", projection="R15c", frame=["+tGeographic vlines", "af"])
# Add a vertical line at 70°E
# Add a line at 70°E
fig.vlines(x=70, pen="1.5p,red3", label="Line 1")
# Add a vertical line at 20°E with latitude limits at 50°S and 70°N
# Add a line at 20°E with latitude limits at 50°S and 70°N
fig.vlines(x=120, ymin=-50, ymax=70, pen="1.5p,dodgerblue3", label="Line 2")
# Add a vertical line at 230°E with latitude limits at 70°S and 80°N
# Add a line at 230°E with latitude limits at 70°S and 80°N
fig.vlines(x=230, ymin=-70, ymax=80, pen="1.5p,gray30,-", label="Line 3")
fig.legend()

Expand All @@ -97,20 +97,20 @@
fig.basemap(region=[0, 360, 0, 1], projection="P10c", frame=["+tPolar hlines", "af"])
# Add a line along radius=0.8
fig.hlines(y=0.8, pen="1.5p,red3", label="Line 1")
# Add a horizontal line along radius=0.5 with azimuth limits at 30° and 160°
# Add a line along radius=0.5 with azimuth limits at 30° and 160°
fig.hlines(y=0.5, xmin=30, xmax=160, pen="1.5p,dodgerblue3", label="Line 2")
# Add a horizontal line along radius=0.25 with azimuth limits at 60° and 270°
# Add a line along radius=0.25 with azimuth limits at 60° and 270°
fig.hlines(y=0.25, xmin=60, xmax=270, pen="1.5p,gray30,-", label="Line 3")
fig.legend()

fig.shift_origin(xshift="w+2c")

fig.basemap(region=[0, 360, 0, 1], projection="P10c", frame=["+tPolar vlines", "af"])
# Add a vertical line along azimuth=120°
# Add a line along azimuth=120°
fig.vlines(x=120, pen="1.5p,red3", label="Line 1")
# Add a vertical line along azimuth=190° with radius limits at 0.2 and 0.8
# Add a line along azimuth=190° with radius limits at 0.2 and 0.8
fig.vlines(x=190, ymin=0.2, ymax=0.8, pen="1.5p,dodgerblue3", label="Line 2")
# Add a vertical line along azimuth=320 with radius limits at 0.5 and 0.9
# Add a line along azimuth=320 with radius limits at 0.5 and 0.9
fig.vlines(x=320, ymin=0.5, ymax=0.9, pen="1.5p,gray30,-", label="Line 3")
fig.legend()

Expand Down
2 changes: 1 addition & 1 deletion pygmt/src/hlines.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def hlines(
- **Cartesian**: lines are plotted as straight lines.
- **Polar**: lines are plotted as arcs along a constant radius.
- **Geographic**: lines are plotted along parallels (constant latitude).
- **Geographic**: lines are plotted as arcs along parallels (i.e., constant latitude).
Parameters
----------
Expand Down
2 changes: 1 addition & 1 deletion pygmt/src/vlines.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def vlines(
- **Cartesian**: lines are plotted as straight lines.
- **Polar**: lines are plotted as straight lines along a constant azimuth.
- **Geographic**: lines are plotted along meridians (constant longitude).
- **Geographic**: lines are plotted as arcs along meridians (i.e., constant longitude).
Parameters
----------
Expand Down

0 comments on commit 8b020ce

Please sign in to comment.