Skip to content
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

Convert test script for segmentizing to doc plot #7967

Merged
merged 10 commits into from
Nov 3, 2023
9 changes: 9 additions & 0 deletions doc/rst/source/plot.rst
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,15 @@ Optional Arguments
the coordinates of a *refpoint* which will serve as a fixed external
reference point for all groups.

.. figure:: /_images/GMT_segmentize.*
:width: 600 px
:align: center

Use the |-F| option to create various networks between input point. Dashed lines
indicate input ordering for the two tables, while solid lines are the resulting
network connections. Top left is original input, while the next five reflect the results
of directives **ra**, **rf**, **rs**, **r**\ 10/35 and **na**.

.. _-G:

**-G**\ *fill*\|\ **+z** :ref:`(more ...) <-Gfill_attrib>`
Expand Down
57 changes: 57 additions & 0 deletions doc/scripts/GMT_segmentize.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
#!/usr/bin/env bash
# Display 6 effect of segmentizing option -F in plot with geographic data

function plotpts
{ # Plots the two data tables and places given text
gmt plot -Sc5p -Ggreen -Wfaint t1.txt
gmt plot -Sc5p -Gblue -Wfaint t2.txt
gmt text -F+cTL+jTL+f7p,Helvetica-Bold+t"$*" -Dj3p
}
cat << EOF > t1.txt
10 10
48 15
28 20
>
40 40
30 5
5 15
EOF
cat << EOF > t2.txt
7 20
29 11
8 4
EOF

gmt begin GMT_segmentize
gmt set GMT_THEME cookbook
gmt set FONT_ANNOT_PRIMARY 9p
gmt subplot begin 2x3 -Fs5c/4.5c -R0/50/0/45 -Sct -Srl -Jx0.1cd -M1p
# Show the data and its natural connectivity
gmt plot -W0.25p,- t[12].txt -c -l"Data connections"+jTL+o2p/12p+gwhite+f6p
printf "5 35\n20 35\n" | gmt plot -W1p -l"New connections"
gmt plot -Sc5p -Ggreen -Wfaint t1.txt -l"Table 1"+jTL+o2p/12p+gwhite
gmt plot -Sc5p -Gblue -Wfaint t2.txt -l"Table 2"
gmt text -F+cTL+jTL+f7p,Helvetica-Bold+t"TWO DATA TABLES" -Dj3p
# Lines from dataset origin
gmt plot -W0.25p,- t[12].txt -c
gmt plot -W1p t[12].txt -Fra
plotpts DATASET ORIGIN
# Lines from table origin
gmt plot -W0.25p,- t[12].txt -c
gmt plot -W1p t[12].txt -Frf
plotpts TABLE ORIGIN
# Lines from segment origin
gmt plot -W0.25p,- t[12].txt -c
gmt plot -W1p t[12].txt -Frs
plotpts SEGMENT ORIGIN
# Lines from fixed origin
gmt plot -W0.25p,- t[12].txt -c
gmt plot -W1p t[12].txt -Fr10/35
plotpts FIXED ORIGIN
echo 10 35 | gmt plot -Sa9p -Gred -Wfaint
# Lines for network
gmt plot -W0.25p,- t[12].txt -c
gmt plot -W1p t[12].txt -Fna
plotpts NETWORK
gmt subplot end
gmt end show
51 changes: 0 additions & 51 deletions test/psxy/geosegmentize.sh

This file was deleted.