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]>
  • Loading branch information
michaelgrund and yvonnefroehlich authored Jan 9, 2025
1 parent 5cee1a3 commit 74f3b70
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions examples/gallery/lines/hlines_vlines.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@
Horizontal and vertical lines
=============================
The :meth:`pygmt.Figure.hlines` and :meth:`pygmt.Figure.vlines`
methods allow to plot horizontal and vertical lines in
Cartesian, Geographic and Polar projections.
The :meth:`pygmt.Figure.hlines` and :meth:`pygmt.Figure.vlines` methods allow to plot
horizontal and vertical lines in Cartesian, geographic and polar projections.
"""

# %%
Expand Down Expand Up @@ -58,15 +57,15 @@
# %%
# Geographic coordinate system
# ----------------------------
# The same can be done for Geographic projections where "horizontal" means lines
# are plotted along parallels (constant latitude) while "vertical" means lines are
# plotted along meridians (constant longitude).
# The same can be done for Geographic projections where "horizontal" means lines are
# plotted along parallels (constant latitude) while "vertical" means lines are plotted
# along meridians (constant longitude).

fig = pygmt.Figure()

fig.basemap(region="g", projection="R15c", frame=["+thlines Geographic", "af"])
# add a red horizontal line at a latitude of 70°N without specifying longitude limits
fig.hlines(y=70, xmin=0, xmax=360, pen="1.5p,red3", label="Line 1")
fig.hlines(y=70, pen="1.5p,red3", label="Line 1")
# add a blue line at a latitude of 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 gray dashed horizontal line at a latitude of 30°S with longitude limits at 60°E
Expand All @@ -78,7 +77,7 @@

fig.basemap(region="g", projection="R15c", frame=["+tvlines Geographic", "af"])
# add a red vertical line at a longitude of 70°E without specifying latitude limits
fig.vlines(x=70, ymin=-90, ymax=90, pen="1.5p,red3", label="Line 1")
fig.vlines(x=70, pen="1.5p,red3", label="Line 1")
# add a blue vertical line at a longitude of 120°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 gray dashed vertical line at a longitude of 230°E with latitude limits at 70°S
Expand All @@ -91,9 +90,9 @@
# %%
# Polar coordinate system
# -----------------------
# When using Polar projections "horizontal" means lines are plotted as
# arcs along a constant radius while "vertical" means lines are plotted as
# straight lines along radius at a specified azimuth.
# When using Polar projections "horizontal" means lines are plotted as arcs along a
# constant radius while "vertical" means lines are plotted as straight lines along
# radius at a specified azimuth.

fig = pygmt.Figure()

Expand Down

0 comments on commit 74f3b70

Please sign in to comment.