Skip to content

Add support for horizontal and vertical lines from a single value in gmt plot#9072

Open
Esteban82 wants to merge 1 commit into
masterfrom
Vertical-Horizontal_Lines
Open

Add support for horizontal and vertical lines from a single value in gmt plot#9072
Esteban82 wants to merge 1 commit into
masterfrom
Vertical-Horizontal_Lines

Conversation

@Esteban82

Copy link
Copy Markdown
Member

This PR adds support for plotting horizontal and vertical lines from a single coordinate value in gmt plot.

Two new symbols are introduced:

-SY plots a horizontal line spanning the full plot width.
-SX plots a vertical line spanning the full plot height.

Example script:

echo 1 > line.txt
echo 3 >> line.txt

gmt begin linea png
    gmt basemap -R0/4/0/4 -Baf -Jx1c
    gmt plot line.txt -SX -Wblue 
    gmt plot line.txt -SY -Wred
    echo 2 | gmt plot -SY -Wgreen,-
gmt end 
linea

At the moment, the implementation only supports Cartesian coordinates.

The long-term goal is to extend the functionality to geographic and polar coordinate systems, similar to the implementation available in PyGMT to plot parallels and meridians, or arcs and straight lines along radius at a specified azimuth. It may also be possible to add analogous functionality to plot3d in the future, including a -SZ option for drawing reference lines along the Z axis.

Question:

Are the proposed symbol codes -SX and -SY acceptable, or would you prefer different letters?

@Esteban82 Esteban82 requested review from a team, PaulWessel, joa-quim and seisman June 25, 2026 19:44
@Esteban82 Esteban82 self-assigned this Jun 25, 2026
@Esteban82 Esteban82 added enhancement Improving an existing feature add-changelog Add PR to the changelog AI-assisted All (or most) of the code was written by Artificial Intelligence. labels Jun 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

add-changelog Add PR to the changelog AI-assisted All (or most) of the code was written by Artificial Intelligence. enhancement Improving an existing feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant