diff --git a/doc/rst/source/explain_line_draw.rst_ b/doc/rst/source/explain_line_draw.rst_ index ea26678bba3..4d31a8ac0d8 100644 --- a/doc/rst/source/explain_line_draw.rst_ +++ b/doc/rst/source/explain_line_draw.rst_ @@ -1,15 +1,16 @@ -**-A**\ [**m**\|\ **p**\|\ **x**\|\ **y**\|\ **r**\|\ **t**] +**-A**\ [**x**\|\ **y**] By default, geographic line segments are drawn as great circle arcs by resampling coarse input data along such arcs. To disable this sampling and draw them as straight lines, use the |-A| flag. For Cartesian data, points are simply connected. To adjust these behaviors, append a directive: - - **m** - Draw the line by first following a meridian, then a parallel. - - **p** - Start following a parallel, then a meridian. (This can be practical - to draw a line along parallels, for example). - - **r** - For polar projections, draw stair-case curves whose first move is along *r*. - - **t** - Same, but first move is along *theta*. - - **x** - For Cartesian data, draw stair-case curves that whose first move is along *x*. - - **y** - Same, but first move is along *y*. + - **x** - First follow *x*, then *y* for staircase curves. + - **y** - First follow *y*, then *x* for staircase curves. + + Here, *x* and *y* have the following meanings: + + - For Cartesian projections, *x* and *y* are the X- and Y-axis. + - For gragraphic projections, *x* and *y* are parallels and meridians. + - For polar projections, *x* and *y* are theta and radius. **Note**: In :doc:`plot3d`, the |-A| option requires constant *z*-coordinates. diff --git a/doc/rst/source/plot.rst b/doc/rst/source/plot.rst index abb44d68d55..17f9b117329 100644 --- a/doc/rst/source/plot.rst +++ b/doc/rst/source/plot.rst @@ -14,7 +14,7 @@ Synopsis **gmt plot** [ *table* ] |-J|\ *parameters* |SYN_OPT-Rz| -[ |-A|\ [**m**\|\ **p**\|\ **x**\|\ **y**\|\ **r**\|\ **t**] ] +[ |-A|\ [**x**\|\ **y**] ] [ |SYN_OPT-B| ] [ |-C|\ *cpt* ] [ |-D|\ *dx*\ [/*dy*] ] @@ -249,13 +249,13 @@ Optional Arguments as column 2 (i.e., third) in any number of files having three columns. Each file may contain any number of segments per file. - **s** - Same but the two curves are given via separate pairs of tables [Default]. - + Several modifiers are at your disposal: - **+g** - We use the *fill* set via |-G| to fill the areas where :math:`y_0(x)` exceeds - :math:`y_1(x)`. For the opposite case, append another *fill* here. + :math:`y_1(x)`. For the opposite case, append another *fill* here. - **+l** - For the primary curve :math:`y_0(x)`, a legend label can be set via option - |SYN_OPT-l|. For a secondary label use this modifier to append the label. + |SYN_OPT-l|. For a secondary label use this modifier to append the label. - **+p** - Specify a separate pen for drawing curve :math:`y_1(x)` [Default is same pen as :math:`y_0(x)`]. See |-W| for specifying the pen for curve :math:`y_0(x)`. - **+r** - Specify a pen to simply draw a line instead of a filled box in the legend, but @@ -309,7 +309,7 @@ Optional Arguments *width* = 0.25p, *color* = black, *style* = solid]. Modifiers can be used to change the appearance of the line: - - **+c** - Determine how the color from the cpt file lookup is applied to symbol + - **+c** - Determine how the color from the cpt file lookup is applied to symbol and|or fill. Append **l** to have the color of the line to be taken from the CPT (see |-C|). If instead **f** is appended then the color from the cpt file is applied to symbol fill. If no argument is given the we use the color for both pen and fill. diff --git a/doc/rst/source/plot3d.rst b/doc/rst/source/plot3d.rst index 706bcd5d011..cb4173d133a 100644 --- a/doc/rst/source/plot3d.rst +++ b/doc/rst/source/plot3d.rst @@ -15,7 +15,7 @@ Synopsis **gmt plot3d** [ *table* ] |-J|\ *parameters* |-Jz|\ \|\ **Z**\ *parameters* |SYN_OPT-Rz| -[ |-A|\ [**m**\|\ **p**\|\ **x**\|\ **y**\|\ **r**\|\ **t**] ] +[ |-A|\ [**x**\|\ **y**] ] [ |SYN_OPT-B| ] [ |-C|\ *cpt* ] [ |-D|\ *dx*/*dy*\ [/*dz*] ] @@ -211,7 +211,7 @@ Optional Arguments *width* = 0.25p, *color* = black, *style* = solid]. Modifiers can be used to change the appearance of the line: - - **+c** - Determine how the color from the cpt file lookup is applied to symbol + - **+c** - Determine how the color from the cpt file lookup is applied to symbol and|or fill. Append **l** to have the color of the line to be taken from the CPT (see |-C|). If instead **f** is appended then the color from the cpt file is applied to symbol fill. If no argument is given the we use the color for both pen and fill. diff --git a/doc/rst/source/psxy.rst b/doc/rst/source/psxy.rst index 0951a6af2cd..aeabaa7e0d2 100644 --- a/doc/rst/source/psxy.rst +++ b/doc/rst/source/psxy.rst @@ -14,7 +14,7 @@ Synopsis **gmt psxy** [ *table* ] |-J|\ *parameters* |SYN_OPT-Rz| -[ |-A|\ [**m**\|\ **p**\|\ **x**\|\ **y**\|\ **r**\|\ **t**] ] +[ |-A|\ [**x**\|\ **y**] ] [ |SYN_OPT-B| ] [ |-C|\ *cpt* ] [ |-D|\ *dx*/*dy* ] diff --git a/doc/rst/source/psxyz.rst b/doc/rst/source/psxyz.rst index d1557f25f90..d8d7b32a336 100644 --- a/doc/rst/source/psxyz.rst +++ b/doc/rst/source/psxyz.rst @@ -15,7 +15,7 @@ Synopsis **gmt psxyz** [ *table* ] |-J|\ *parameters* |-J|\ **z**\|\ **Z**\ *parameters* |SYN_OPT-Rz| -[ |-A|\ [**m**\|\ **p**\|\ **x**\|\ **y**\|\ **r**\|\ **t**] ] +[ |-A|\ [**x**\|\ **y**] ] [ |SYN_OPT-B| ] [ |-C|\ *cpt* ] [ |-D|\ *dx*/*dy*\ [/*dz*] ] diff --git a/src/psxy.c b/src/psxy.c index 81816564009..894f23b51be 100644 --- a/src/psxy.c +++ b/src/psxy.c @@ -43,7 +43,7 @@ struct PSXY_CTRL { bool no_RJ_needed; /* Special case of -T and no -B when -R -J is not required */ - struct PSXY_A { /* -A[m|y|p|x|r|t] */ + struct PSXY_A { /* -A[x|y]] */ bool active; unsigned int mode; double step; @@ -529,7 +529,7 @@ static int usage (struct GMTAPI_CTRL *API, int level) { const char *mod_name = &name[4]; /* To skip the leading gmt for usage messages */ if (level == GMT_MODULE_PURPOSE) return (GMT_NOERROR); - GMT_Usage (API, 0, "usage: %s [] %s %s [-A[m|p|r|t|x|y]] [%s] [-C] [-D/] [%s] [-F%s] [-G|+z] " + GMT_Usage (API, 0, "usage: %s [
] %s %s [-A[x|y]] [%s] [-C] [-D/] [%s] [-F%s] [-G|+z] " "[-H[]] [-I[]] %s[%s] [-M[c|s][+g][+l][+p][+r[]][+y[]]] [-N[c|r]] %s%s [-S[][]] [%s] [%s] [-W[][]] [%s] [%s] " "[-Z|[+t|T]] [%s] [%s] %s[%s] [%s] [%s] [%s] [%s] [%s] [%s] [%s] [%s] [%s] [%s] [%s] [%s]\n", name, GMT_J_OPT, GMT_Rgeoz_OPT, GMT_B_OPT, PSXY_E_OPT, GMT_SEGMENTIZE3, API->K_OPT, PLOT_L_OPT, API->O_OPT, API->P_OPT, @@ -542,15 +542,15 @@ static int usage (struct GMTAPI_CTRL *API, int level) { GMT_Message (API, GMT_TIME_NONE, " REQUIRED ARGUMENTS:\n"); GMT_Option (API, "<,J-Z,R"); GMT_Message (API, GMT_TIME_NONE, "\n OPTIONAL ARGUMENTS:\n"); - GMT_Usage (API, 1, "\n-A[m|p|r|t|x|y]"); + GMT_Usage (API, 1, "\n-A[x|y]"); GMT_Usage (API, -2, "Suppress drawing geographic line segments as great circle arcs, i.e., draw " - "straight lines instead. Six optional directives instead convert paths to staircase curves:"); - GMT_Usage (API, 3, "m: First follow meridians, then parallels when connecting geographic points."); - GMT_Usage (API, 3, "p: First follow parallels, then meridians when connecting geographic point."); - GMT_Usage (API, 3, "r: First follow radius, then theta for staircase curves for Polar projection."); - GMT_Usage (API, 3, "t: First follow theta, then radius for staircase curves for Polar projection."); - GMT_Usage (API, 3, "x: First follow x, then y for staircase curves for Cartesian projections."); - GMT_Usage (API, 3, "y: First follow y, then x for staircase curves for Cartesian projections."); + "straight lines instead. Two optional directives instead convert paths to staircase curves:"); + GMT_Usage (API, 3, "x: First follow x, then y for staircase curves."); + GMT_Usage (API, 3, "y: First follow y, then x for staircase curves."); + GMT_Usage (API, -2, "Here, x and y have the following meanings: " + "For Cartesian projections, x and y are the X- and Y-axis; " + "For gragraphic projections, x and y are parallels and meridians; " + "For polar projections, x and y are theta and radius."); GMT_Option (API, "B-"); GMT_Usage (API, 1, "\n-C|,[,,...]"); GMT_Usage (API, -2, "Assign symbol colors based on z-value in 3rd column. " @@ -837,6 +837,7 @@ static int parse (struct GMT_CTRL *GMT, struct PSXY_CTRL *Ctrl, struct GMT_OPTIO case 'A': /* Turn off draw_arc mode */ n_errors += gmt_M_repeated_module_option (API, Ctrl->A.active); + /* There are 6 optional directives but only x|y are documented since 6.6.0 */ switch (opt->arg[0]) { case 'm': case 'y': case 'r': Ctrl->A.mode = GMT_STAIRS_Y; break; case 'p': case 'x': case 't': Ctrl->A.mode = GMT_STAIRS_X; break; diff --git a/src/psxyz.c b/src/psxyz.c index 5c8ded89a5f..dffbffb9203 100644 --- a/src/psxyz.c +++ b/src/psxyz.c @@ -40,7 +40,7 @@ /* Control structure for psxyz */ struct PSXYZ_CTRL { - struct PSXYZ_A { /* -A[m|y|p|x|r|t|step] */ + struct PSXYZ_A { /* -A[x|y] */ bool active; unsigned int mode; double step; @@ -173,7 +173,7 @@ static int usage (struct GMTAPI_CTRL *API, int level) { const char *mod_name = &name[4]; /* To skip the leading gmt for usage messages */ const char *T[2] = {" [-T]", ""}; if (level == GMT_MODULE_PURPOSE) return (GMT_NOERROR); - GMT_Usage (API, 0, "usage: %s [
] %s %s [%s] [%s] [-A[m|p|r|t|x|y]] [-C] [-D/[/]] [-G] " + GMT_Usage (API, 0, "usage: %s [
] %s %s [%s] [%s] [-A[x|y]] [-C] [-D/[/]] [-G] " "[-H[]] [-I[]] %s [%s] [-N[c|r]] %s %s[-Q] [-S[][][/size_y]]%s [%s] [%s] [-W[][]] " "[%s] [%s] [-Z|[+t|T]] [%s] [%s] %s[%s] [%s] [%s] [%s] [%s] [%s] [%s] [%s] [%s] [%s] [%s] [%s] [%s]\n", name, GMT_J_OPT, GMT_Rgeoz_OPT, GMT_B_OPT, GMT_Jz_OPT, API->K_OPT, PLOT_L_OPT, API->O_OPT, API->P_OPT, @@ -187,15 +187,15 @@ static int usage (struct GMTAPI_CTRL *API, int level) { GMT_Option (API, "<,J-Z,R3"); GMT_Message (API, GMT_TIME_NONE, "\n OPTIONAL ARGUMENTS:\n"); GMT_Option (API, "B-"); - GMT_Usage (API, 1, "\n-A[m|p|r|t|x|y]"); + GMT_Usage (API, 1, "\n-A[x|y]"); GMT_Usage (API, -2, "Suppress drawing geographic line segments as great circle arcs, i.e., draw " - "straight lines instead. Six optional directives instead convert paths to staircase curves:"); - GMT_Usage (API, 3, "m: First follow meridians, then parallels when connecting geographic points."); - GMT_Usage (API, 3, "p: First follow parallels, then meridians when connecting geographic point."); - GMT_Usage (API, 3, "r: First follow radius, then theta for staircase curves for Polar projection."); - GMT_Usage (API, 3, "t: First follow theta, then radius for staircase curves for Polar projection."); - GMT_Usage (API, 3, "x: First follow x, then y for staircase curves for Cartesian projections."); - GMT_Usage (API, 3, "y: First follow y, then x for staircase curves for Cartesian projections."); + "straight lines instead. Two optional directives instead convert paths to staircase curves:"); + GMT_Usage (API, 3, "x: First follow x, then y for staircase curves."); + GMT_Usage (API, 3, "y: First follow y, then x for staircase curves."); + GMT_Usage (API, -2, "Here, x and y have the following meanings: " + "For Cartesian projections, x and y are the X- and Y-axis; " + "For gragraphic projections, x and y are parallels and meridians; " + "For polar projections, x and y are theta and radius."); GMT_Usage (API, 1, "\n-C|,[,,...]"); GMT_Usage (API, -2, "Assign symbol colors based on z-value in 3rd column. " "Note: requires -S. Without -S, %s excepts lines/polygons " @@ -422,6 +422,7 @@ static int parse (struct GMT_CTRL *GMT, struct PSXYZ_CTRL *Ctrl, struct GMT_OPTI case 'A': /* Turn off draw_arc mode */ n_errors += gmt_M_repeated_module_option (API, Ctrl->A.active); + /* There are 6 optional directives but only x|y are documented since 6.6.0 */ switch (opt->arg[0]) { case 'm': case 'y': case 'r': Ctrl->A.mode = GMT_STAIRS_Y; break; case 'p': case 'x': case 't': Ctrl->A.mode = GMT_STAIRS_X; break; diff --git a/test/baseline/psxy.dvc b/test/baseline/psxy.dvc index c70941fab9d..f859c7dbf9d 100644 --- a/test/baseline/psxy.dvc +++ b/test/baseline/psxy.dvc @@ -1,5 +1,5 @@ outs: -- md5: 239f4bd18d38b222c7da4a1fa70bb7aa.dir +- md5: c597478c2dfc51aa340071f73df8731c.dir nfiles: 142 path: psxy hash: md5 diff --git a/test/psxy/nojump.sh b/test/psxy/nojump.sh index 551de997ff4..7c3e43adb3f 100755 --- a/test/psxy/nojump.sh +++ b/test/psxy/nojump.sh @@ -12,5 +12,5 @@ cat << EOF > t.txt 115 -20 EOF gmt psxy -R110/215/-27/20 -JM6i t.txt -Wfat,green -Baf -BWSne -A -P -K -Xc > $ps -gmt psxy -R -J t.txt -Wfat,green -Baf -BWSne -Ap -O -K -Y3.15i >> $ps +gmt psxy -R -J t.txt -Wfat,green -Baf -BWSne -Ax -O -K -Y3.15i >> $ps gmt psxy -R -J t.txt -Wfat,green -Baf -BWSne -O -Y3.15i >> $ps diff --git a/test/psxy/polarcurves.sh b/test/psxy/polarcurves.sh index aa609f631be..4e9cd1f918b 100755 --- a/test/psxy/polarcurves.sh +++ b/test/psxy/polarcurves.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -# test the -Ar|t line-resampling for polar projections +# test the -Ax|y line-resampling for polar projections cat << EOF > t.txt 10 5 30 4 @@ -10,11 +10,11 @@ gmt begin polarcurves ps gmt subplot set 0 -A"No -A" gmt plot -W2p,red t.txt gmt plot t.txt -Sc0.2c -Wthin - gmt subplot set 1 -A"-At: @~q@~, then r" - gmt plot -W2p,red -At t.txt + gmt subplot set 1 -A"-Ax: @~q@~, then r" + gmt plot -W2p,red -Ax t.txt gmt plot t.txt -Sc0.2c -Wthin - gmt subplot set 2 -A"-Ar: r, then @~q@~" - gmt plot -W2p,red -Ar t.txt + gmt subplot set 2 -A"-Ay: r, then @~q@~" + gmt plot -W2p,red -Ay t.txt gmt plot t.txt -Sc0.2c -Wthin gmt subplot end gmt end show