Skip to content

Commit fb62cfb

Browse files
PaulWesselseisman
andauthored
Realigning order of basemap frame, gridlines, and annotations/ticks for all modules (#4274)
* Ensure gridlines are layed down first except for images and similar Now, annotations are always at end but gridlines may happen before plotting of data. * More refinement of grdlines * pssolar with gridlines at end * New approach * Update psrose.c * Dont reuse n_bins for somethng else * Lay down -B before imates in psimage for now Starge messing with -R -J inside makes it difficult to do later * Let -B gridlines work after image anyway. * Fix 3-D axis, grdview, psmask orders * Update gmt_plot.c * Confirm orders settings and always let ticks come after frame * Update psevents.c * Update gmt_plot.c * Update gmt_plot.c * Fix ticks before frame * Misc updates * psclip needs -R -J if -B is set * Fix how scalebar is drawn in rose and document both in rose and wiggle * Improve rose scripts * Fix frame placement with -Nc * Update doc/scripts failures * Update doc/examples for failures * Update test/geodesy failures * Update test/gmtbinstats failures * Update test/gmtlogo failure * Update test/gmtmath failures * Update test/gmtregress failures * Update test/gmtselect failure * Update test/gmtspatial failure * Update test/grdcontour failures * Update test/grdcut failure * Update test/grdvector failures * Update test/grdview failure * Update test/greenspline failure * Update test/modern failure * Update test/potential failures * Update test/psrose failures * Update most test/psxy failures * Update test/segy failure * Update test/seis failures * Update test/pshistogram failures * Update test/pscontour failure * Update test/psxy/poleline.ps - needs fix anyway * Update test/psxyz/3dbars - needs fixe anyway * Update gmt_plot.c to fix diagona.sh test * Update logos.ps after gmt_plot.c fix. * Update psclip.c * Plot gridlines on top of polylgons in psxy[z] * Improve psxy/z frame settings * Update PS after psxy/z fixes * Fix 3d psxyz and update PS * Update psxy.c * Update ErrorEllipseGeo.sh * Update psxy.c * Update psxy.c * Update geo ellipse * Fix anim03.sh and update PS * Fix double frame reported * Update tinye PS changes * Update psrose.c * Temporarily enable full CI tests * Disable full tests Co-authored-by: Dongdong Tian <[email protected]>
1 parent 26323de commit fb62cfb

File tree

151 files changed

+512
-263
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

151 files changed

+512
-263
lines changed

doc/examples/anim03/anim03.ps

167 Bytes
Binary file not shown.

doc/examples/ex03/ex03.ps

-5 Bytes
Binary file not shown.

doc/examples/ex06/ex06.ps

71 Bytes
Binary file not shown.

doc/examples/ex08/ex08.ps

257 Bytes
Binary file not shown.

doc/examples/ex10/ex10.ps

293 Bytes
Binary file not shown.

doc/examples/ex18/ex18.ps

2.75 KB
Binary file not shown.

doc/examples/ex24/ex24.ps

3.26 KB
Binary file not shown.

doc/examples/ex33/ex33.bat

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ gmt begin ex33
2222
REM Show upper/lower values encountered as an envelope
2323
gmt convert stack.txt -o0,5 > env.txt
2424
gmt convert stack.txt -o0,6 -I -T >> env.txt
25-
gmt plot -R-200/200/-3500/-2000 -Bxafg1000+l"Distance from ridge (km)" -Byaf+l"Depth (m)" -BWSne -JX6i/3i -Glightgray env.txt -Yh+3c
26-
gmt plot -W3p stack.txt
25+
gmt plot -R-200/200/-3500/-2000 -JX6i/3i -Glightgray env.txt -Yh+3c
26+
gmt plot -W3p stack.txt -Bxafg1000+l"Distance from ridge (km)" -Byaf+l"Depth (m)" -BWSne
2727
echo 0 -2000 MEDIAN STACKED PROFILE | gmt text -Gwhite -F+jTC+f14p -Dj8p
2828
REM cleanup
2929
del ridge.txt table.txt env.txt stack.txt

doc/examples/ex33/ex33.ps

23 Bytes
Binary file not shown.

doc/examples/ex33/ex33.sh

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,8 @@ gmt begin ex33
2525
# Show upper/lower values encountered as an envelope
2626
gmt convert stack.txt -o0,5 > env.txt
2727
gmt convert stack.txt -o0,6 -I -T >> env.txt
28-
gmt plot -R-200/200/-3500/-2000 -Bxafg1000+l"Distance from ridge (km)" -Byaf+l"Depth (m)" -BWSne \
29-
-JX15c/7.5c -Glightgray env.txt -Yh+3c
30-
gmt plot -W3p stack.txt
28+
gmt plot -R-200/200/-3500/-2000 -JX15c/7.5c -Glightgray env.txt -Yh+3c
29+
gmt plot -W3p stack.txt -Bxafg1000+l"Distance from ridge (km)" -Byaf+l"Depth (m)" -BWSne
3130
echo "0 -2000 MEDIAN STACKED PROFILE" | gmt text -Gwhite -F+jTC+f14p -Dj8p
3231
# cleanup
3332
rm -f ridge.txt table.txt env.txt stack.txt spac_33.nc

doc/examples/ex41/ex41.bat

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ REM
66
gmt begin ex41
77
gmt set FONT_ANNOT_PRIMARY 12p FONT_LABEL 12p
88
gmt makecpt -Cred,orange,yellow,green,bisque,cyan,magenta,white,gray -T1/10/1 -N
9-
gmt coast -R130W/50W/8N/56N -JM14c -B0 -Glightgray -Sazure1 -A1000 -Wfaint --MAP_FRAME_TYPE=plain
9+
gmt coast -R130W/50W/8N/56N -JM14c -Glightgray -Sazure1 -A1000 -Wfaint
1010
gmt coast -EUS+glightyellow+pfaint -ECU+glightred+pfaint -EMX+glightgreen+pfaint -ECA+glightblue+pfaint
11-
gmt coast -N1/1p,darkred -A1000/2/2 -Wfaint -Cazure1
11+
gmt coast -N1/1p,darkred -A1000/2/2 -Wfaint -Cazure1 -B0 --MAP_FRAME_TYPE=plain
1212
gmt plot -Sk@symbol_41/0.25c -C -W0.25p -: @data_41.txt
1313
gmt legend -DJTL+w14c+jBL+l1.2+o0/0.3c -C4p -F+p+gsnow1 @table_41.txt
1414
gmt end show

doc/examples/ex41/ex41.ps

1.14 KB
Binary file not shown.

doc/examples/ex41/ex41.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
gmt begin ex41
88
gmt set FONT_ANNOT_PRIMARY 12p FONT_LABEL 12p
99
gmt makecpt -Cred,orange,yellow,green,bisque,cyan,magenta,white,gray -T1/10/1 -N
10-
gmt coast -R130W/50W/8N/56N -JM14c -B0 -Glightgray -Sazure1 -A1000 -Wfaint --MAP_FRAME_TYPE=plain
10+
gmt coast -R130W/50W/8N/56N -JM14c -Glightgray -Sazure1 -A1000 -Wfaint
1111
gmt coast -EUS+glightyellow+pfaint -ECU+glightred+pfaint -EMX+glightgreen+pfaint -ECA+glightblue+pfaint
1212
gmt coast -N1/1p,darkred -A1000/2/2 -Wfaint -Cazure1
13-
gmt plot -Sk@symbol_41/0.25c -C -W0.25p -: @data_41.txt
13+
gmt plot -Sk@symbol_41/0.25c -C -W0.25p -: @data_41.txt -B0 --MAP_FRAME_TYPE=plain
1414
gmt legend -DJTL+w14c+jBL+l1.2+o0/0.3c -C4p -F+p+gsnow1 @table_41.txt
1515
gmt end show

doc/examples/ex50/ex50.bat

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ gmt begin ex50
1717
gmt math -T-4/4/0.1 T ZPDF = p.txt
1818
gmt plot -R-4/4/0/0.4 p.txt -L+yb -Glightgreen -W1p -BWS -Bxa1 -Byaf -Y2.25c
1919
REM Plot t distribution
20-
gmt plot -R-4/4/0/0.4 p.txt -W1p,lightgray -BWS -Bxa1 -Byaf -Y2.25c
20+
gmt plot -R-4/4/0/0.4 p.txt -W1p,lightgray -Y2.25c
2121
gmt math -T-4/4/0.1 T 3 TPDF = p.txt
22-
gmt plot p.txt -L+yb -Glightgreen -W1p
22+
gmt plot p.txt -L+yb -Glightgreen -W1p -BWS -Bxa1 -Byaf
2323
REM Plot F distribution
2424
gmt math -T0/6/0.02 T 20 12 FPDF = p.txt
2525
gmt plot -R0/6/0/1.02 p.txt -L+yb -Glightgreen -W1p -BWS -Bxa1 -Byaf -Y2.25c
@@ -49,9 +49,9 @@ gmt begin ex50
4949
gmt math -T-4/4/0.1 T ZCDF = p.txt
5050
gmt plot -R-4/4/0/1.02 p.txt -L+yb -Glightred -W1p -BES -Bxa1 -Byaf -Y2.25c
5151
REM Plot t cumulative distribution
52-
gmt plot -R-4/4/0/1.02 p.txt -W1p,lightgray -BES -Bxa1 -Byaf -Y2.25c
52+
gmt plot -R-4/4/0/1.02 p.txt -W1p,lightgray -Y2.25c
5353
gmt math -T-4/4/0.1 T 3 TCDF = p.txt
54-
gmt plot p.txt -L+yb -Glightred -W1p
54+
gmt plot p.txt -L+yb -Glightred -W1p -BES -Bxa1 -Byaf
5555
REM Plot F cumulative distribution
5656
gmt math -T0/6/0.02 T 20 12 FCDF = p.txt
5757
gmt plot -R0/6/0/1.02 p.txt -L+yb -Glightred -W1p -BES -Bxa1 -Byaf -Y2.25c

doc/examples/ex50/ex50.ps

756 Bytes
Binary file not shown.

doc/examples/ex50/ex50.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ gmt begin ex50
1818
gmt math -T-4/4/0.1 T ZPDF = p.txt
1919
gmt plot -R-4/4/0/0.4 p.txt -L+yb -Glightgreen -W1p -BWS -Bxa1 -Byaf -Y2.25c
2020
# Plot t distribution
21-
gmt plot -R-4/4/0/0.4 p.txt -W1p,lightgray -BWS -Bxa1 -Byaf -Y2.25c
21+
gmt plot -R-4/4/0/0.4 p.txt -W1p,lightgray -Y2.25c
2222
gmt math -T-4/4/0.1 T 3 TPDF = p.txt
23-
gmt plot p.txt -L+yb -Glightgreen -W1p
23+
gmt plot p.txt -L+yb -Glightgreen -W1p -BWS -Bxa1 -Byaf
2424
# Plot F distribution
2525
gmt math -T0/6/0.02 T 20 12 FPDF = p.txt
2626
gmt plot -R0/6/0/1.02 p.txt -L+yb -Glightgreen -W1p -BWS -Bxa1 -Byaf -Y2.25c
@@ -50,9 +50,9 @@ gmt begin ex50
5050
gmt math -T-4/4/0.1 T ZCDF = p.txt
5151
gmt plot -R-4/4/0/1.02 p.txt -L+yb -Glightred -W1p -BES -Bxa1 -Byaf -Y2.25c
5252
# Plot t cumulative distribution
53-
gmt plot -R-4/4/0/1.02 p.txt -W1p,lightgray -BES -Bxa1 -Byaf -Y2.25c
53+
gmt plot -R-4/4/0/1.02 p.txt -W1p,lightgray -Y2.25c
5454
gmt math -T-4/4/0.1 T 3 TCDF = p.txt
55-
gmt plot p.txt -L+yb -Glightred -W1p
55+
gmt plot p.txt -L+yb -Glightred -W1p -BES -Bxa1 -Byaf
5656
# Plot F cumulative distribution
5757
gmt math -T0/6/0.02 T 20 12 FCDF = p.txt
5858
gmt plot -R0/6/0/1.02 p.txt -L+yb -Glightred -W1p -BES -Bxa1 -Byaf -Y2.25c

doc/rst/source/rose_common.rst_

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,9 @@ Optional Arguments
6262
.. _-F:
6363

6464
**-F**
65-
Do not draw the scale length bar [Default plots scale in lower right corner provided **-B** is used]
65+
Do *not* draw the scale length bar [Default plots scale bar in lower right corner
66+
provided **-B** is used. We use :term:`MAP_TICK_PEN_PRIMARY` to draw the scale and
67+
label it with :term:`FONT_ANNOT_PRIMARY`].
6668

6769
.. _-G:
6870

doc/rst/source/wiggle_common.rst_

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,8 @@ Optional Arguments
7676
**-DJ** is used to place a scale outside the map frame while **-Dj** is used to place it inside the frame.
7777
Move scale label to the left side with **+al** [Default is to the right of the scale].
7878
Append **+l** to set the *z* unit label that is used in the scale label [no unit].
79-
The :term:`FONT_ANNOT_PRIMARY` is used for the font setting.
79+
The :term:`FONT_ANNOT_PRIMARY` is used for the font setting, while :term:`MAP_TICK_PEN_PRIMARY`
80+
is used to draw the scale bar.
8081

8182
.. _-F:
8283

doc/scripts/GMT_App_E.ps

6.9 KB
Binary file not shown.

doc/scripts/GMT_RGBchart_tabloid.ps

-38.4 KB
Binary file not shown.

doc/scripts/GMT_base_symbols4.ps

4 Bytes
Binary file not shown.

doc/scripts/GMT_registration.ps

94 Bytes
Binary file not shown.

src/geodesy/psvelo.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -847,8 +847,10 @@ EXTERN_MSC int GMT_psvelo (void *V_API, int mode, void *args) {
847847
if (gmt_M_err_pass (GMT, gmt_map_setup (GMT, GMT->common.R.wesn), "")) Return (GMT_PROJECTION_ERROR);
848848

849849
if ((PSL = gmt_plotinit (GMT, options)) == NULL) Return (GMT_RUNTIME_ERROR);
850+
gmt_set_basemap_orders (GMT, Ctrl->N.active ? GMT_BASEMAP_FRAME_BEFORE : GMT_BASEMAP_FRAME_AFTER, GMT_BASEMAP_GRID_BEFORE, GMT_BASEMAP_ANNOT_AFTER);
850851
gmt_plane_perspective (GMT, GMT->current.proj.z_project.view_plane, GMT->current.proj.z_level);
851852
gmt_plotcanvas (GMT); /* Fill canvas if requested */
853+
gmt_map_basemap (GMT); /* Basemap before data */
852854

853855
gmt_M_memset (dim, PSL_MAX_DIMS, double);
854856
gmt_setpen (GMT, &Ctrl->W.pen);
@@ -1053,7 +1055,7 @@ EXTERN_MSC int GMT_psvelo (void *V_API, int mode, void *args) {
10531055

10541056
PSL_setdash (PSL, NULL, 0);
10551057

1056-
gmt_map_basemap (GMT);
1058+
gmt_map_basemap (GMT); /* Basemap after data */
10571059
gmt_plane_perspective (GMT, -1, 0.0);
10581060
gmt_plotend (GMT);
10591061

src/gmt_constants.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,17 @@ enum GMT_enum_script {GMT_BASH_MODE = 0, /* Write Bash script */
158158
GMT_CSH_MODE, /* Write C-shell script */
159159
GMT_DOS_MODE}; /* Write DOS script */
160160

161+
/*! Various mode for basemap order */
162+
enum GMT_enum_basemap {
163+
GMT_BASEMAP_BEFORE = 0,
164+
GMT_BASEMAP_AFTER = 1,
165+
GMT_BASEMAP_FRAME_BEFORE = 0,
166+
GMT_BASEMAP_FRAME_AFTER = 1,
167+
GMT_BASEMAP_GRID_BEFORE = 0,
168+
GMT_BASEMAP_GRID_AFTER = 2,
169+
GMT_BASEMAP_ANNOT_BEFORE = 0,
170+
GMT_BASEMAP_ANNOT_AFTER = 4};
171+
161172
/* Since -I is not a global option but we almost use it as such, we define the long-option for it here.
162173
* Modules that need it in their module_kw[] array can just add it to their list. */
163174
#define GMT_INCREMENT_KW { '/', 'I', "increment", "", "", "e,n", "exact,number" }

src/gmt_init.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13813,6 +13813,8 @@ struct GMT_CTRL *gmt_init_module (struct GMTAPI_CTRL *API, const char *lib_name,
1381313813
}
1381413814
if (options && strstr (mod_name, "grdflexure") && (opt = GMT_Find_Option (API, 'Q', *options))) /* Must turn off g */
1381513815
required = "";
13816+
if (options && strstr (mod_name, "psclip") && (opt = GMT_Find_Option (API, 'C', *options)) && (opt = GMT_Find_Option (API, 'B', *options))) /* psclip -C with -B requires -R -J */
13817+
required = "JR";
1381613818

1381713819
if (options && !strcmp (mod_name, "pscoast") && (E = GMT_Find_Option (API, 'E', *options)) && (opt = GMT_Find_Option (API, 'R', *options)) == NULL) {
1381813820
/* Running pscoast -E without -R: Must make sure any the region-information in -E is added as args to new -R.

0 commit comments

Comments
 (0)