From 38732491462962c795d818e1bfd9bbf3e9dd048f Mon Sep 17 00:00:00 2001 From: Paul Wessel Date: Tue, 5 Sep 2023 15:58:17 +0200 Subject: [PATCH 01/18] WIP Treat stroke symbols like other symbols Refer to #7788 for background. This WIP PR covers psxy and seems to work as explained. Will do the same for psxyz. --- src/psxy.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/psxy.c b/src/psxy.c index 5524502c674..eedc92f5db1 100644 --- a/src/psxy.c +++ b/src/psxy.c @@ -501,6 +501,15 @@ GMT_LOCAL void psxy_plot_end_vectors (struct GMT_CTRL *GMT, double *x, double *y PSL_command (GMT->PSL, "U\n"); } +GMT_LOCAL bool psxy_is_stroke_symbol (int symbol) { + /* Return true if cross, x, y, - symbols */ + if (symbol == PSL_CROSS) return true; + if (symbol == PSL_XDASH) return true; + if (symbol == PSL_YDASH) return true; + if (symbol == PSL_PLUS) return true; + return false; +} + static int usage (struct GMTAPI_CTRL *API, int level) { /* This displays the psxy synopsis and optionally full usage information */ @@ -1472,7 +1481,7 @@ EXTERN_MSC int GMT_psxy (void *V_API, int mode, void *args) { if (penset_OK) gmt_setpen (GMT, ¤t_pen); if (not_line) { /* Symbol part (not counting GMT_SYMBOL_FRONT, GMT_SYMBOL_QUOTED_LINE, GMT_SYMBOL_DECORATED_LINE) */ - bool periodic = false, delayed_unit_scaling = false, E_bar_above = false, E_bar_below = false; + bool periodic = false, delayed_unit_scaling = false, E_bar_above = false, E_bar_below = false, stroke_symb = false; unsigned int n_warn[3] = {0, 0, 0}, warn, item, n_times, col; double xpos[2], width = 0.0, dim[PSL_MAX_DIMS], data_magnitude; struct GMT_RECORD *In = NULL; @@ -1706,6 +1715,13 @@ EXTERN_MSC int GMT_psxy (void *V_API, int mode, void *args) { PSL_command (PSL, "/QR_outline false def\n"); } + if (psxy_is_stroke_symbol (S.symbol)) { + if (!Ctrl->W.active) { + current_pen.width = 0.20 * S.size_x * PSL_POINTS_PER_INCH; + if (!Ctrl->W.active) + gmt_M_rgb_copy (current_pen.rgb, current_fill.rgb); + } + } if (gmt_geo_to_xy (GMT, in[GMT_X], in[GMT_Y], &plot_x, &plot_y)) continue; /* NaNs on input */ if (gmt_M_is_dnan (plot_x)) { /* Transformation of x yielded a NaN (e.g. log (-ve)) */ From 27d453ba41937dd5453dbab55fb221860fa26879 Mon Sep 17 00:00:00 2001 From: Paul Wessel Date: Tue, 5 Sep 2023 16:28:27 +0200 Subject: [PATCH 02/18] Same for psxyz they share the same stroke symbols. --- src/psxy.c | 5 +++-- src/psxyz.c | 18 ++++++++++++++++++ 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/src/psxy.c b/src/psxy.c index eedc92f5db1..b504c13a81d 100644 --- a/src/psxy.c +++ b/src/psxy.c @@ -1481,7 +1481,7 @@ EXTERN_MSC int GMT_psxy (void *V_API, int mode, void *args) { if (penset_OK) gmt_setpen (GMT, ¤t_pen); if (not_line) { /* Symbol part (not counting GMT_SYMBOL_FRONT, GMT_SYMBOL_QUOTED_LINE, GMT_SYMBOL_DECORATED_LINE) */ - bool periodic = false, delayed_unit_scaling = false, E_bar_above = false, E_bar_below = false, stroke_symb = false; + bool periodic = false, delayed_unit_scaling = false, E_bar_above = false, E_bar_below = false; unsigned int n_warn[3] = {0, 0, 0}, warn, item, n_times, col; double xpos[2], width = 0.0, dim[PSL_MAX_DIMS], data_magnitude; struct GMT_RECORD *In = NULL; @@ -1715,7 +1715,8 @@ EXTERN_MSC int GMT_psxy (void *V_API, int mode, void *args) { PSL_command (PSL, "/QR_outline false def\n"); } - if (psxy_is_stroke_symbol (S.symbol)) { + if (psxy_is_stroke_symbol (S.symbol)) { /* These are only stroked, not filled */ + /* Unless -W was set, compute pen width from symbol size and get pen color from G or z->CPT */ if (!Ctrl->W.active) { current_pen.width = 0.20 * S.size_x * PSL_POINTS_PER_INCH; if (!Ctrl->W.active) diff --git a/src/psxyz.c b/src/psxyz.c index 27b6d07a7d6..a86d4844a48 100644 --- a/src/psxyz.c +++ b/src/psxyz.c @@ -136,6 +136,15 @@ struct PSXYZ_DATA { struct GMT_CUSTOM_SYMBOL *custom; }; +GMT_LOCAL bool psxyz_is_stroke_symbol (int symbol) { + /* Return true if cross, x, y, - symbols */ + if (symbol == PSL_CROSS) return true; + if (symbol == PSL_XDASH) return true; + if (symbol == PSL_YDASH) return true; + if (symbol == PSL_PLUS) return true; + return false; +} + static void *New_Ctrl (struct GMT_CTRL *GMT) { /* Allocate and initialize a new control structure */ struct PSXYZ_CTRL *C; @@ -1352,6 +1361,15 @@ EXTERN_MSC int GMT_psxyz (void *V_API, int mode, void *args) { if (S.base_set & GMT_BASE_ORIGIN) data[n].flag |= 32; /* Flag that base needs to be added to height(s) */ + if (psxyz_is_stroke_symbol (S.symbol)) { /* These are only stroked, not filled */ + /* Unless -W was set, compute pen width from symbol size and get pen color from G or z->CPT */ + if (!Ctrl->W.active) { + current_pen.width = 0.20 * S.size_x * PSL_POINTS_PER_INCH; + if (!Ctrl->W.active) + gmt_M_rgb_copy (current_pen.rgb, current_fill.rgb); + } + } + if (Ctrl->W.cpt_effect) { if (Ctrl->W.pen.cptmode & 1) { /* Change pen color via CPT */ gmt_M_rgb_copy (Ctrl->W.pen.rgb, current_fill.rgb); From 1061057c9837a1a29f7889527a84ee819ccbece4 Mon Sep 17 00:00:00 2001 From: Paul Wessel Date: Tue, 5 Sep 2023 16:46:34 +0200 Subject: [PATCH 03/18] Only override color it one has been set --- src/psxy.c | 2 +- src/psxyz.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/psxy.c b/src/psxy.c index b504c13a81d..a7550c2a2ea 100644 --- a/src/psxy.c +++ b/src/psxy.c @@ -1719,7 +1719,7 @@ EXTERN_MSC int GMT_psxy (void *V_API, int mode, void *args) { /* Unless -W was set, compute pen width from symbol size and get pen color from G or z->CPT */ if (!Ctrl->W.active) { current_pen.width = 0.20 * S.size_x * PSL_POINTS_PER_INCH; - if (!Ctrl->W.active) + if (!Ctrl->W.active && current_fill.rgb[0] > -0.5) gmt_M_rgb_copy (current_pen.rgb, current_fill.rgb); } } diff --git a/src/psxyz.c b/src/psxyz.c index a86d4844a48..6a88fd12682 100644 --- a/src/psxyz.c +++ b/src/psxyz.c @@ -1365,7 +1365,7 @@ EXTERN_MSC int GMT_psxyz (void *V_API, int mode, void *args) { /* Unless -W was set, compute pen width from symbol size and get pen color from G or z->CPT */ if (!Ctrl->W.active) { current_pen.width = 0.20 * S.size_x * PSL_POINTS_PER_INCH; - if (!Ctrl->W.active) + if (!Ctrl->W.active && current_fill.rgb[0] > -0.5) gmt_M_rgb_copy (current_pen.rgb, current_fill.rgb); } } From 3182e9fd340169cc504d10b9b4d2237715a92175 Mon Sep 17 00:00:00 2001 From: Paul Wessel Date: Tue, 5 Sep 2023 17:00:08 +0200 Subject: [PATCH 04/18] Update the docs for strokable symbols --- doc/rst/source/explain_symbols.rst_ | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/doc/rst/source/explain_symbols.rst_ b/doc/rst/source/explain_symbols.rst_ index 4f9e25447b5..275696bcbc3 100644 --- a/doc/rst/source/explain_symbols.rst_ +++ b/doc/rst/source/explain_symbols.rst_ @@ -83,10 +83,13 @@ **-Sy**\ *size* y-dash (\|). *size* is the length of a short vertical (y-dir) line segment. - **Note**: The uppercase symbols **A**, **C**, **D**, **G**, **H**, **I**, **N**, + **Notes**: (1) The uppercase symbols **A**, **C**, **D**, **G**, **H**, **I**, **N**, **S**, **T** are normalized to have the same *area* as a circle with diameter *size*, while the *size* of the corresponding lowercase symbols - refers to the diameter of a circumscribed circle. + refers to the diameter of a circumscribed circle. (2) The stroke-only symbols + **x**, **y**, **+** and **-** will derive their pen widths from the symbol size + and their pen color from |-G| or |-C|. In that sense they behave as the other + symbols (but no outline). You can override this behavior by specifying |-W|. The next collection shows five symbols that require two or more parameters, and some have optional modifiers to enhance the symbol appearance. From ebad147cde4fd728e7ea1148f8c0ec6bc7aac703 Mon Sep 17 00:00:00 2001 From: Paul Wessel Date: Tue, 5 Sep 2023 17:15:27 +0200 Subject: [PATCH 05/18] Add a constant for the default size to pen width factor --- src/gmt_constants.h | 3 +++ src/psxy.c | 2 +- src/psxyz.c | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/gmt_constants.h b/src/gmt_constants.h index da2d8fece63..b700b509b20 100644 --- a/src/gmt_constants.h +++ b/src/gmt_constants.h @@ -257,6 +257,9 @@ enum GMT_time_period { #define GMT_TEXT_CLEARANCE 15 /* Clearance around text in textboxes, in percent */ #define GMT_TEXT_OFFSET 20 /* Offset of text from refpoint, in percent */ +/* Conversion from symbol size to pen width for stroke-only symbols x,y,+, - */ +#define GMT_SYMBOL_SIZE_TO_PEN_WIDTH 0.15; + #define GMT_N_MAX_MODEL 20 /* No more than 20 basis functions in a trend model */ #define GMT_PAIR_COORD 0 /* Tell gmt_get_pair to get both x and y as coordinates */ diff --git a/src/psxy.c b/src/psxy.c index a7550c2a2ea..fc66aec6d50 100644 --- a/src/psxy.c +++ b/src/psxy.c @@ -1718,7 +1718,7 @@ EXTERN_MSC int GMT_psxy (void *V_API, int mode, void *args) { if (psxy_is_stroke_symbol (S.symbol)) { /* These are only stroked, not filled */ /* Unless -W was set, compute pen width from symbol size and get pen color from G or z->CPT */ if (!Ctrl->W.active) { - current_pen.width = 0.20 * S.size_x * PSL_POINTS_PER_INCH; + current_pen.width = GMT_SYMBOL_SIZE_TO_PEN_WIDTH * S.size_x * PSL_POINTS_PER_INCH; if (!Ctrl->W.active && current_fill.rgb[0] > -0.5) gmt_M_rgb_copy (current_pen.rgb, current_fill.rgb); } diff --git a/src/psxyz.c b/src/psxyz.c index 6a88fd12682..cadc59af1ae 100644 --- a/src/psxyz.c +++ b/src/psxyz.c @@ -1364,7 +1364,7 @@ EXTERN_MSC int GMT_psxyz (void *V_API, int mode, void *args) { if (psxyz_is_stroke_symbol (S.symbol)) { /* These are only stroked, not filled */ /* Unless -W was set, compute pen width from symbol size and get pen color from G or z->CPT */ if (!Ctrl->W.active) { - current_pen.width = 0.20 * S.size_x * PSL_POINTS_PER_INCH; + current_pen.width = GMT_SYMBOL_SIZE_TO_PEN_WIDTH * S.size_x * PSL_POINTS_PER_INCH; if (!Ctrl->W.active && current_fill.rgb[0] > -0.5) gmt_M_rgb_copy (current_pen.rgb, current_fill.rgb); } From 8fbfaa892c616942890fd4968b0e49d4293f4f36 Mon Sep 17 00:00:00 2001 From: Paul Wessel Date: Tue, 5 Sep 2023 17:20:01 +0200 Subject: [PATCH 06/18] Update gmt_constants.h --- src/gmt_constants.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gmt_constants.h b/src/gmt_constants.h index b700b509b20..cab6b687aca 100644 --- a/src/gmt_constants.h +++ b/src/gmt_constants.h @@ -258,7 +258,7 @@ enum GMT_time_period { #define GMT_TEXT_OFFSET 20 /* Offset of text from refpoint, in percent */ /* Conversion from symbol size to pen width for stroke-only symbols x,y,+, - */ -#define GMT_SYMBOL_SIZE_TO_PEN_WIDTH 0.15; +#define GMT_SYMBOL_SIZE_TO_PEN_WIDTH 0.15 #define GMT_N_MAX_MODEL 20 /* No more than 20 basis functions in a trend model */ From 43388ecfb65a0f8e087be9edb485860346c79972 Mon Sep 17 00:00:00 2001 From: Paul Wessel Date: Wed, 6 Sep 2023 08:06:41 +0200 Subject: [PATCH 07/18] Fix color assignment if -G or -C given --- src/psxy.c | 7 +++---- src/psxyz.c | 7 +++---- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/psxy.c b/src/psxy.c index fc66aec6d50..5e482599774 100644 --- a/src/psxy.c +++ b/src/psxy.c @@ -1717,11 +1717,10 @@ EXTERN_MSC int GMT_psxy (void *V_API, int mode, void *args) { if (psxy_is_stroke_symbol (S.symbol)) { /* These are only stroked, not filled */ /* Unless -W was set, compute pen width from symbol size and get pen color from G or z->CPT */ - if (!Ctrl->W.active) { + if (!Ctrl->W.active) /* No pen width given, compute from symbol size */ current_pen.width = GMT_SYMBOL_SIZE_TO_PEN_WIDTH * S.size_x * PSL_POINTS_PER_INCH; - if (!Ctrl->W.active && current_fill.rgb[0] > -0.5) - gmt_M_rgb_copy (current_pen.rgb, current_fill.rgb); - } + if (current_fill.rgb[0] > -0.5) /* Color given, use it for the stroke */ + gmt_M_rgb_copy (current_pen.rgb, current_fill.rgb); } if (gmt_geo_to_xy (GMT, in[GMT_X], in[GMT_Y], &plot_x, &plot_y)) continue; /* NaNs on input */ diff --git a/src/psxyz.c b/src/psxyz.c index cadc59af1ae..d1d5067b611 100644 --- a/src/psxyz.c +++ b/src/psxyz.c @@ -1363,11 +1363,10 @@ EXTERN_MSC int GMT_psxyz (void *V_API, int mode, void *args) { if (psxyz_is_stroke_symbol (S.symbol)) { /* These are only stroked, not filled */ /* Unless -W was set, compute pen width from symbol size and get pen color from G or z->CPT */ - if (!Ctrl->W.active) { + if (!Ctrl->W.active) /* No pen width given, compute from symbol size */ current_pen.width = GMT_SYMBOL_SIZE_TO_PEN_WIDTH * S.size_x * PSL_POINTS_PER_INCH; - if (!Ctrl->W.active && current_fill.rgb[0] > -0.5) - gmt_M_rgb_copy (current_pen.rgb, current_fill.rgb); - } + if (current_fill.rgb[0] > -0.5) /* Color given, use it for the stroke */ + gmt_M_rgb_copy (current_pen.rgb, current_fill.rgb); } if (Ctrl->W.cpt_effect) { From aff771556d489566c01e973ef8ef2574d3909832 Mon Sep 17 00:00:00 2001 From: Paul Wessel Date: Wed, 6 Sep 2023 09:59:57 +0200 Subject: [PATCH 08/18] Introduce new default MAP_STROKE_WIDTH --- doc/rst/source/explain_symbols.rst_ | 4 +++- doc/rst/source/gmt.conf.rst | 7 +++++++ src/gmt_constants.h | 2 +- src/gmt_defaults.h | 2 ++ src/gmt_init.c | 25 ++++++++++++++++++++++++- src/gmt_keywords.txt | 1 + src/psxy.c | 4 ++-- src/psxyz.c | 2 +- 8 files changed, 41 insertions(+), 6 deletions(-) diff --git a/doc/rst/source/explain_symbols.rst_ b/doc/rst/source/explain_symbols.rst_ index 275696bcbc3..04601186846 100644 --- a/doc/rst/source/explain_symbols.rst_ +++ b/doc/rst/source/explain_symbols.rst_ @@ -89,7 +89,9 @@ refers to the diameter of a circumscribed circle. (2) The stroke-only symbols **x**, **y**, **+** and **-** will derive their pen widths from the symbol size and their pen color from |-G| or |-C|. In that sense they behave as the other - symbols (but no outline). You can override this behavior by specifying |-W|. + symbols (but no outline). You can override this behavior by specifying |-W|, + modify it by adjusting :term:`MAP_STROKE_WIDTH` [15%], or set it to zero to + rely on pen defaults (and |-W|). The next collection shows five symbols that require two or more parameters, and some have optional modifiers to enhance the symbol appearance. diff --git a/doc/rst/source/gmt.conf.rst b/doc/rst/source/gmt.conf.rst index c3aa2dfc633..8f1e89457f0 100644 --- a/doc/rst/source/gmt.conf.rst +++ b/doc/rst/source/gmt.conf.rst @@ -868,6 +868,13 @@ MAP Parameters cap is reversed, i.e., *85/90* will draw a r = 5 radius circle at the center of the map with less frequent radial lines there. + **MAP_STROKE_WIDTH** + Used to convert non-fillable (**x**, **y**, **+** and **-**) symbol sizes + to the width of the pen used to stroke these symbols. Give a factor in the + 0-1 range (e.g., 0.18) or specify a percentage (e.g., 10%) [15%]. **Note**: + If set to 0 then no such conversion takes place and pen settings must rely on + **-W** or module defaults. + **MAP_SCALE_HEIGHT** Sets the height (> 0) on the map of the map scale bars drawn by various programs [default is **5p**]. diff --git a/src/gmt_constants.h b/src/gmt_constants.h index cab6b687aca..e3d2e2a45ee 100644 --- a/src/gmt_constants.h +++ b/src/gmt_constants.h @@ -258,7 +258,7 @@ enum GMT_time_period { #define GMT_TEXT_OFFSET 20 /* Offset of text from refpoint, in percent */ /* Conversion from symbol size to pen width for stroke-only symbols x,y,+, - */ -#define GMT_SYMBOL_SIZE_TO_PEN_WIDTH 0.15 +#define GMT_SYMBOL_SIZE_TO_PEN_WIDTH 15 /* 15% */ #define GMT_N_MAX_MODEL 20 /* No more than 20 basis functions in a trend model */ diff --git a/src/gmt_defaults.h b/src/gmt_defaults.h index 8d968b08b4f..6dce82a25bf 100644 --- a/src/gmt_defaults.h +++ b/src/gmt_defaults.h @@ -154,6 +154,8 @@ struct GMT_DEFAULTS { double map_graph_extension; /* If map_frame_type is graph, how must longer to make axis length. [7.5%] */ double map_graph_origin[2]; /* x- and y-origin of graph axis if graph-origin is in use [data 0/0] */ double map_graph_shift; /* Extra offset for title to avoid overwriting the centered y-axis */ + double map_stroke_width; /* Conversion factor from symbol size to stroke pen width (non-fillable symbols only) */ + char map_stroke_width_unit; /* Either % or not */ unsigned int map_annot_oblique; /* Controls annotations and tick angles etc. [GMT_OBL_ANNOT_ANYWHERE] */ unsigned int map_grid_cross_type[2]; /* 0 = normal cross, 1 = symmetric tick, 2 = asymmetric tick */ unsigned int map_logo_justify; /* Justification of the GMT timestamp box [1 (BL)] */ diff --git a/src/gmt_init.c b/src/gmt_init.c index 8c35a767376..72f458ed034 100644 --- a/src/gmt_init.c +++ b/src/gmt_init.c @@ -208,7 +208,7 @@ struct GMT_parameter { const char *name; }; -/* These are the active GMT5+ keywords, containing no backwards-compatible variants. +/* These are the active >= GMT5 keywords, containing no backwards-compatible variants. * Also, some grouped keywords such as FONT and FONT_ANNOT are also not listed since they are not in gmt.conf. * If new keywords are added they need to be added here as well as to gmt_keywords.txt, plus * specific entries in both gmtlib_setparameter and gmtlib_getparameter, and gmt.conf.rst */ @@ -314,6 +314,7 @@ static struct GMT_parameter GMT_keyword_active[]= { { 0, "MAP_ORIGIN_Y"}, { 0, "MAP_POLAR_CAP"}, { 0, "MAP_SCALE_HEIGHT"}, + { 0, "MAP_STROKE_WIDTH"}, { 0, "MAP_TICK_LENGTH_PRIMARY"}, { 0, "MAP_TICK_LENGTH_SECONDARY"}, { 0, "MAP_TICK_PEN_PRIMARY"}, @@ -6616,6 +6617,9 @@ GMT_LOCAL void gmtinit_conf_classic (struct GMT_CTRL *GMT) { /* MAP_POLAR_CAP */ GMT->current.setting.map_polar_cap[0] = 85; GMT->current.setting.map_polar_cap[1] = 90; + /* MAP_STROKE_WIDTH */ + GMT->current.setting.map_stroke_width = GMT_SYMBOL_SIZE_TO_PEN_WIDTH / 100.0; /* Given as percentage */ + GMT->current.setting.map_stroke_width_unit = '%'; /* MAP_SCALE_HEIGHT */ GMT->current.setting.map_scale_height = 5 * pt; /* 5p */ GMT->current.setting.given_unit[GMTCASE_MAP_SCALE_HEIGHT] = 'p'; @@ -11237,6 +11241,19 @@ unsigned int gmtlib_setparameter (struct GMT_CTRL *GMT, const char *keyword, cha GMT->current.setting.map_polar_cap[1] = inc[GMT_X]; } break; + case GMTCASE_MAP_STROKE_WIDTH: + dval = atof (value); + if (value[len] == '%') { + dval /= 100.0; /* Got factor as a percentage */ + GMT->current.setting.map_stroke_width_unit = '%'; + } + else /* Got a fraction */ + GMT->current.setting.map_stroke_width_unit = '\0'; + if (dval < 0.0) + error = true; + else + GMT->current.setting.map_stroke_width = dval; + break; case GMTCASE_MAP_SCALE_HEIGHT: dval = gmt_M_to_inch (GMT, value); if (dval <= 0.0) @@ -12798,6 +12815,12 @@ char *gmtlib_getparameter (struct GMT_CTRL *GMT, const char *keyword) { else snprintf (value, GMT_LEN256, "%g/%g", GMT->current.setting.map_polar_cap[0], GMT->current.setting.map_polar_cap[1]); break; + case GMTCASE_MAP_STROKE_WIDTH: + if (GMT->current.setting.map_stroke_width_unit == '%') /* Report as percentage */ + snprintf (value, GMT_LEN256, "%g%%", GMT->current.setting.map_stroke_width * 100.0); + else /* Just a factor */ + snprintf (value, GMT_LEN256, "%g", GMT->current.setting.map_stroke_width); + break; case GMTCASE_MAP_SCALE_HEIGHT: snprintf (value, GMT_LEN256, "%g%c", GMT->current.setting.map_scale_height * gmt_M_def_scale(GMTCASE_MAP_SCALE_HEIGHT), gmt_M_def_unit(GMTCASE_MAP_SCALE_HEIGHT)); break; diff --git a/src/gmt_keywords.txt b/src/gmt_keywords.txt index 822af20341a..bafb727aa9c 100644 --- a/src/gmt_keywords.txt +++ b/src/gmt_keywords.txt @@ -127,6 +127,7 @@ MAP_ORIGIN_X # x-value of lower-left corner of map relative to page [1i] MAP_ORIGIN_Y # y-value of lower-left corner of map relative to page [1i] MAP_POLAR_CAP # Modify gridline spacing for polar caps MAP_SCALE_HEIGHT # Height of scale bar on maps +MAP_STROKE_WIDTH # Percent of strokable-only symbol size for stroke pen width [15%] MAP_TICK_LENGTH # Length of major and minor frame axes ticks [does not go in gmt.conf] MAP_TICK_LENGTH_PRIMARY # Length of major and minor primary frame axes ticks MAP_TICK_LENGTH_SECONDARY # Length of major and minor secondary frame axes ticks diff --git a/src/psxy.c b/src/psxy.c index 5e482599774..99b17a6d1f3 100644 --- a/src/psxy.c +++ b/src/psxy.c @@ -1717,8 +1717,8 @@ EXTERN_MSC int GMT_psxy (void *V_API, int mode, void *args) { if (psxy_is_stroke_symbol (S.symbol)) { /* These are only stroked, not filled */ /* Unless -W was set, compute pen width from symbol size and get pen color from G or z->CPT */ - if (!Ctrl->W.active) /* No pen width given, compute from symbol size */ - current_pen.width = GMT_SYMBOL_SIZE_TO_PEN_WIDTH * S.size_x * PSL_POINTS_PER_INCH; + if (!Ctrl->W.active) /* No pen width given, compute from symbol size unless conversion factor is 0 */ + current_pen.width = (gmt_M_is_zero (GMT->current.setting.map_stroke_width)) ? GMT->current.setting.map_default_pen.width : GMT->current.setting.map_stroke_width * S.size_x * PSL_POINTS_PER_INCH; if (current_fill.rgb[0] > -0.5) /* Color given, use it for the stroke */ gmt_M_rgb_copy (current_pen.rgb, current_fill.rgb); } diff --git a/src/psxyz.c b/src/psxyz.c index d1d5067b611..cc9c547bcba 100644 --- a/src/psxyz.c +++ b/src/psxyz.c @@ -1364,7 +1364,7 @@ EXTERN_MSC int GMT_psxyz (void *V_API, int mode, void *args) { if (psxyz_is_stroke_symbol (S.symbol)) { /* These are only stroked, not filled */ /* Unless -W was set, compute pen width from symbol size and get pen color from G or z->CPT */ if (!Ctrl->W.active) /* No pen width given, compute from symbol size */ - current_pen.width = GMT_SYMBOL_SIZE_TO_PEN_WIDTH * S.size_x * PSL_POINTS_PER_INCH; + current_pen.width = (gmt_M_is_zero (GMT->current.setting.map_stroke_width)) ? GMT->current.setting.map_default_pen.width : GMT->current.setting.map_stroke_width * S.size_x * PSL_POINTS_PER_INCH; if (current_fill.rgb[0] > -0.5) /* Color given, use it for the stroke */ gmt_M_rgb_copy (current_pen.rgb, current_fill.rgb); } From 370f465355b1da966282e440e6e4ddce3df444ee Mon Sep 17 00:00:00 2001 From: Paul Wessel Date: Wed, 6 Sep 2023 11:25:59 +0200 Subject: [PATCH 09/18] Minor fixes --- src/psxy.c | 6 ++++-- test/psxy/all_psxy_symbols.txt | 2 +- test/psxy/plot_symbols.sh | 4 ++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/psxy.c b/src/psxy.c index 99b17a6d1f3..105ac7ef2a3 100644 --- a/src/psxy.c +++ b/src/psxy.c @@ -2081,9 +2081,11 @@ EXTERN_MSC int GMT_psxy (void *V_API, int mode, void *args) { } break; case GMT_SYMBOL_TEXT: - if (Ctrl->G.active && !outline_active) + if (fill_active && !outline_active) PSL_setcolor (PSL, current_fill.rgb, PSL_IS_FILL); - else if (!Ctrl->G.active) + else if (fill_active) + PSL_setcolor (PSL, current_fill.rgb, outline_setting); + else PSL_setfill (PSL, GMT->session.no_rgb, outline_setting); (void) gmt_setfont (GMT, &S.font); direction = (S.azim) ? gmt_azim_to_angle (GMT, in[GMT_X], in[GMT_Y], 0.1, S.angle) : S.angle; diff --git a/test/psxy/all_psxy_symbols.txt b/test/psxy/all_psxy_symbols.txt index 8920202f80a..36c6e12f284 100644 --- a/test/psxy/all_psxy_symbols.txt +++ b/test/psxy/all_psxy_symbols.txt @@ -1,5 +1,5 @@ # All the basic psxy symbols + two customs to fill the table -# ALl dimensions hardwired to be in inches +# All dimensions hardwired to be in inches 0.5 0.5 1i - 1.5 0.5 1i + 2.5 0.5 1i a diff --git a/test/psxy/plot_symbols.sh b/test/psxy/plot_symbols.sh index ab9219cae4e..d201fbaa053 100755 --- a/test/psxy/plot_symbols.sh +++ b/test/psxy/plot_symbols.sh @@ -4,7 +4,7 @@ ps=plot_symbols.ps -gmt psxy -R0/4/1/6 -Jx1i -P -Bg1 -Gred -W0.25p -S1i -X2i -Y2i << EOF > $ps +gmt psxy -R0/4/1/6 -Jx1i -P -Bg1 -W0.25p -S1i -X2i -Y2i << EOF > $ps > Fat pen -W2p 0.5 5.5 - > Plain red symbols -W- -Gred @@ -29,7 +29,7 @@ gmt psxy -R0/4/1/6 -Jx1i -P -Bg1 -Gred -W0.25p -S1i -X2i -Y2i << EOF > $ps > Blue wedges -Gblue 3.5 2.5 80 30 w 0.5 1.5 30 80 w -> Fat red pen -W2p,red +> Fat red pen -W2p,red -G- 1.5 1.5 x > Fat pen -W2p 1.5 1.5 + From fb3526d31fe9e70e6e6423462ae2822497fa02a3 Mon Sep 17 00:00:00 2001 From: Paul Wessel Date: Wed, 6 Sep 2023 20:27:19 +0200 Subject: [PATCH 10/18] Deal with resets after reading symbols from data file --- src/psxy.c | 8 ++++++-- src/psxyz.c | 14 ++++++++++---- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/src/psxy.c b/src/psxy.c index 105ac7ef2a3..dc08e45a6ce 100644 --- a/src/psxy.c +++ b/src/psxy.c @@ -1717,10 +1717,12 @@ EXTERN_MSC int GMT_psxy (void *V_API, int mode, void *args) { if (psxy_is_stroke_symbol (S.symbol)) { /* These are only stroked, not filled */ /* Unless -W was set, compute pen width from symbol size and get pen color from G or z->CPT */ - if (!Ctrl->W.active) /* No pen width given, compute from symbol size unless conversion factor is 0 */ + if (!outline_active) /* No pen width given, compute from symbol size unless conversion factor is 0 */ current_pen.width = (gmt_M_is_zero (GMT->current.setting.map_stroke_width)) ? GMT->current.setting.map_default_pen.width : GMT->current.setting.map_stroke_width * S.size_x * PSL_POINTS_PER_INCH; - if (current_fill.rgb[0] > -0.5) /* Color given, use it for the stroke */ + if (current_fill.rgb[0] > -0.5) { /* Color given, use it for the stroke */ + save_pen = current_pen; gmt_M_rgb_copy (current_pen.rgb, current_fill.rgb); + } } if (gmt_geo_to_xy (GMT, in[GMT_X], in[GMT_Y], &plot_x, &plot_y)) continue; /* NaNs on input */ @@ -2346,6 +2348,8 @@ EXTERN_MSC int GMT_psxy (void *V_API, int mode, void *args) { if (S.read_symbol_cmd && (S.symbol == PSL_VECTOR || S.symbol == GMT_SYMBOL_GEOVECTOR || S.symbol == PSL_MARC)) { /* Reset status */ current_pen = save_pen; current_fill = save_fill; Ctrl->W.active = save_W; Ctrl->G.active = save_G; } + else if (psxy_is_stroke_symbol (S.symbol)) /* Reset */ + gmt_M_rgb_copy (current_pen.rgb, save_pen.rgb); if (Ctrl->H.active) current_pen = nominal_pen; } while (true); if (GMT->common.t.variable) { /* Reset the transparencies */ diff --git a/src/psxyz.c b/src/psxyz.c index cc9c547bcba..bcdad0d61f7 100644 --- a/src/psxyz.c +++ b/src/psxyz.c @@ -743,7 +743,7 @@ EXTERN_MSC int GMT_psxyz (void *V_API, int mode, void *args) { double bar_gap, bar_width, bar_step, nominal_size_x, nominal_size_y, *t_for_cpt = NULL; double axes[2] = {0.0, 0.0}, Az = 0.0, factor = 1.0; - struct GMT_PEN default_pen, current_pen, last_headpen, last_spiderpen; + struct GMT_PEN default_pen, current_pen, last_headpen, last_spiderpen, save_pen; struct GMT_FILL default_fill, current_fill, black, no_fill; struct GMT_SYMBOL S; struct GMT_PALETTE *P = NULL; @@ -1363,10 +1363,12 @@ EXTERN_MSC int GMT_psxyz (void *V_API, int mode, void *args) { if (psxyz_is_stroke_symbol (S.symbol)) { /* These are only stroked, not filled */ /* Unless -W was set, compute pen width from symbol size and get pen color from G or z->CPT */ - if (!Ctrl->W.active) /* No pen width given, compute from symbol size */ + if (!outline_active) /* No pen width given, compute from symbol size */ current_pen.width = (gmt_M_is_zero (GMT->current.setting.map_stroke_width)) ? GMT->current.setting.map_default_pen.width : GMT->current.setting.map_stroke_width * S.size_x * PSL_POINTS_PER_INCH; - if (current_fill.rgb[0] > -0.5) /* Color given, use it for the stroke */ + if (current_fill.rgb[0] > -0.5) { /* Color given, use it for the stroke */ + save_pen = current_pen; gmt_M_rgb_copy (current_pen.rgb, current_fill.rgb); + } } if (Ctrl->W.cpt_effect) { @@ -1697,7 +1699,11 @@ EXTERN_MSC int GMT_psxyz (void *V_API, int mode, void *args) { if (S.user_unit[GMT_Y]) data[n].flag |= 8; n++; - if (read_symbol) API->object[API->current_item[GMT_IN]]->n_expected_fields = GMT_MAX_COLUMNS; + if (read_symbol) { + API->object[API->current_item[GMT_IN]]->n_expected_fields = GMT_MAX_COLUMNS; + if (psxyz_is_stroke_symbol (S.symbol)) /* Reset */ + gmt_M_rgb_copy (current_pen.rgb, save_pen.rgb); + } } while (true); if (GMT_End_IO (API, GMT_IN, 0) != GMT_NOERROR) { /* Disables further data input */ From 2fd6eb33c26bdadeebe219e1a4bdbf371143e76e Mon Sep 17 00:00:00 2001 From: Paul Wessel Date: Thu, 7 Sep 2023 11:13:07 +0200 Subject: [PATCH 11/18] Fix some PS and scripts --- doc/scripts/GMT_base_symbols1.sh | 28 ++++++++++++++-------------- doc/scripts/images.dvc | 4 ++-- src/gmt_support.c | 1 + test/baseline/grdgradient.dvc | 4 ++-- test/baseline/grdimage.dvc | 4 ++-- test/baseline/psxy.dvc | 4 ++-- test/filter1d/mfilter.sh | 2 +- test/psbasemap/mapscales.sh | 2 +- test/psxyz/plot_symbols.sh | 2 +- 9 files changed, 26 insertions(+), 25 deletions(-) diff --git a/doc/scripts/GMT_base_symbols1.sh b/doc/scripts/GMT_base_symbols1.sh index 370ad36de68..df71cc74cb1 100755 --- a/doc/scripts/GMT_base_symbols1.sh +++ b/doc/scripts/GMT_base_symbols1.sh @@ -6,20 +6,20 @@ gmt begin GMT_base_symbols1 gmt set GMT_THEME cookbook cat << EOF > tmp.txt # All the basic geometric psxy symbols -1 2 1c - -2 2 1c + -3 2 1c a -4 2 1c c -5 2 1c d -6 2 1c g -7 2 1c h -1 1 1c i -2 1 1c n -3 1 1c p -4 1 1c s -5 1 1c t -6 1 1c x -7 1 1c y +1 2 1c a +2 2 1c c +3 2 1c d +4 2 1c g +5 2 1c h +6 2 1c i +7 2 1c n +1 1 1c p +2 1 1c s +3 1 1c t +4 1 1c x +5 1 1c y +6 1 1c - +7 1 1c + EOF gmt plot tmp.txt -R0.6/7.4/0.6/2.4 -B0g1 -B+n -Jx1.5c -Sc1c -W0.25p --PROJ_LENGTH_UNIT=cm -i0,1 --MAP_GRID_PEN_PRIMARY=default,dashed gmt plot tmp.txt -S -Glightblue -W1p --PROJ_LENGTH_UNIT=cm diff --git a/doc/scripts/images.dvc b/doc/scripts/images.dvc index a53ab8fe960..9f2bd9ffe1e 100644 --- a/doc/scripts/images.dvc +++ b/doc/scripts/images.dvc @@ -1,5 +1,5 @@ outs: -- md5: e026fa468e0ece337e57095ec2ed1808.dir - size: 33329636 +- md5: 09ff36fa8f9eac3d342863ddbcbc5890.dir + size: 33329641 nfiles: 201 path: images diff --git a/src/gmt_support.c b/src/gmt_support.c index 20a2ff62295..f4d2a0bbf8f 100644 --- a/src/gmt_support.c +++ b/src/gmt_support.c @@ -12011,6 +12011,7 @@ int gmt_get_format (struct GMT_CTRL *GMT, double interval, char *unit, char *pre char text[GMT_BUFSIZ]; size_t s_length; + if (fabs (interval) < GMT_CONV15_LIMIT) interval = 0.0; if (!strcmp (GMT->current.setting.format_float_map, "%.12g")) { /* Default map format given means auto-detect decimals */ /* Find number of decimals needed in the format statement */ diff --git a/test/baseline/grdgradient.dvc b/test/baseline/grdgradient.dvc index 3ece2c1a396..8e425a4f436 100644 --- a/test/baseline/grdgradient.dvc +++ b/test/baseline/grdgradient.dvc @@ -1,5 +1,5 @@ outs: -- md5: b9407eab4b5bfa2882be7c7bad88a838.dir - size: 1651104 +- md5: 79f65165bfb0d2ce72ab851940b3afa9.dir + size: 1652327 nfiles: 5 path: grdgradient diff --git a/test/baseline/grdimage.dvc b/test/baseline/grdimage.dvc index e9fad7ea99e..d2337fd9da4 100644 --- a/test/baseline/grdimage.dvc +++ b/test/baseline/grdimage.dvc @@ -1,5 +1,5 @@ outs: -- md5: 707d1f260c2f0d51f6a3671d747950e4.dir - size: 8665406 +- md5: 9bb70e197903539f8102f14b5328cb69.dir + size: 8666635 nfiles: 30 path: grdimage diff --git a/test/baseline/psxy.dvc b/test/baseline/psxy.dvc index 1c31cefcf92..b2cc7265acd 100644 --- a/test/baseline/psxy.dvc +++ b/test/baseline/psxy.dvc @@ -1,5 +1,5 @@ outs: -- md5: 5caa9a7a3ea8e1fd9bd0a3d108f019db.dir - size: 9395372 +- md5: f0f19dd140ffd72f80b46158a466c24f.dir + size: 9405256 nfiles: 144 path: psxy diff --git a/test/filter1d/mfilter.sh b/test/filter1d/mfilter.sh index 5508105e7f6..7271266a4c4 100755 --- a/test/filter1d/mfilter.sh +++ b/test/filter1d/mfilter.sh @@ -6,4 +6,4 @@ URL=https://scrippsco2.ucsd.edu/assets/data/atmospheric/stations/in_situ_co2/wee gmt filter1d $URL -T1o+t -Fg30 --TIME_UNIT=d -f0T --IO_HEADER_MARKER=\" > monthly.txt gmt psxy -R1958T/2018T/300/430 -JX6iT/4i -Bxa10Yf5y -Byaf+u" ppm" -BWSne -W0.25p monthly.txt -P -K -Xc > $ps gmt psxy -R2012T/2013T/380/410 -J -Bsxa1Y -Bpxa1Og1o -Byaf+u" ppm" -BWSne+t"Keeling CO@-2@- curve" $URL -Sc0.2c -Gred -O -K -Y4.75i --IO_HEADER_MARKER=\" >> $ps -gmt psxy -R -J -Sx0.2i -W1p,blue monthly.txt -O >> $ps +gmt psxy -R -J -Sx0.2i -Gblue monthly.txt -O >> $ps diff --git a/test/psbasemap/mapscales.sh b/test/psbasemap/mapscales.sh index 6bb8c33889e..31a64c92df9 100755 --- a/test/psbasemap/mapscales.sh +++ b/test/psbasemap/mapscales.sh @@ -11,7 +11,7 @@ gmt psbasemap -R -J -Lg0/-7+c-7+w500M+jTC -F+gcornsilk1+p0.5p,black+s -O -K --FO gmt psbasemap -R -J -Lg0/-10+c-10+w500n+u+jTC -F+gcornsilk1+p0.5p,black -O -K --FONT_LABEL=32p --FONT_ANNOT_PRIMARY=24p >> $ps gmt psbasemap -R -J -Lg0/-12.5+c-12.5+w3e6f+jTC -F+gcornsilk1+p0.5p,black -O -K --FONT_LABEL=32p --FONT_ANNOT_PRIMARY=24p --FORMAT_FLOAT_MAP=%\'.10g >> $ps # Plot a red cross at the justification point for the scales -gmt psxy -R -J -O -Sx0.2i -W0.5p,red << EOF >> $ps +gmt psxy -R -J -O -Sx0.2i -Gred << EOF >> $ps 0 14 0 11 0 8 diff --git a/test/psxyz/plot_symbols.sh b/test/psxyz/plot_symbols.sh index 9136f5476c1..3e2e9966505 100755 --- a/test/psxyz/plot_symbols.sh +++ b/test/psxyz/plot_symbols.sh @@ -29,7 +29,7 @@ gmt psxyz -R0/4/1/6 -Jx1i -P -Bg1 -Gred -W0.25p -p155/35 -S1i -X1i -Y1i -K << EO > Blue wedges -Gblue 3.5 2.5 0 80 30 w 0.5 1.5 0 30 80 w -> Fat red pen -W2p,red +> Fat red pen -W2p,red -G- 1.5 1.5 0 x > Fat pen -W2p 1.5 1.5 0 + From bc6867a40fb8b9a36627283257be6ce8a12ed408 Mon Sep 17 00:00:00 2001 From: Paul Wessel Date: Thu, 7 Sep 2023 11:28:00 +0200 Subject: [PATCH 12/18] More PS updates --- test/baseline/filter1d.dvc | 4 ++-- test/baseline/psbasemap.dvc | 4 ++-- test/baseline/psxy.dvc | 4 ++-- test/baseline/psxyz.dvc | 4 ++-- test/psxy/bezvec.sh | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/test/baseline/filter1d.dvc b/test/baseline/filter1d.dvc index 360c6bedebc..fb8a69848d2 100644 --- a/test/baseline/filter1d.dvc +++ b/test/baseline/filter1d.dvc @@ -1,5 +1,5 @@ outs: -- md5: 17eb890ce6ca5e7c8a6d8d6b124420ac.dir - size: 251237 +- md5: 411dc7bd2fc692a5248368543dff2800.dir + size: 251233 nfiles: 6 path: filter1d diff --git a/test/baseline/psbasemap.dvc b/test/baseline/psbasemap.dvc index a7c37b7a904..734b2cf648e 100644 --- a/test/baseline/psbasemap.dvc +++ b/test/baseline/psbasemap.dvc @@ -1,5 +1,5 @@ outs: -- md5: a3e3468d2d600a6b909d0f34a552e677.dir - size: 2903150 +- md5: d844a65d237eeb5ecd27b79fb325c08f.dir + size: 2904428 nfiles: 56 path: psbasemap diff --git a/test/baseline/psxy.dvc b/test/baseline/psxy.dvc index b2cc7265acd..d1cfbd43215 100644 --- a/test/baseline/psxy.dvc +++ b/test/baseline/psxy.dvc @@ -1,5 +1,5 @@ outs: -- md5: f0f19dd140ffd72f80b46158a466c24f.dir - size: 9405256 +- md5: 9b5f30d07ca7e9e7307cd6e88c694ee3.dir + size: 9406894 nfiles: 144 path: psxy diff --git a/test/baseline/psxyz.dvc b/test/baseline/psxyz.dvc index 36b0d72adf9..b1410b6d78f 100644 --- a/test/baseline/psxyz.dvc +++ b/test/baseline/psxyz.dvc @@ -1,5 +1,5 @@ outs: -- md5: f1f78c83dcce8de006622526ee5b1d10.dir - size: 1177367 +- md5: e8300f3b8e45690deb50c78d03d3e548.dir + size: 1179003 nfiles: 28 path: psxyz diff --git a/test/psxy/bezvec.sh b/test/psxy/bezvec.sh index 5574b2af1e2..87693b6325e 100755 --- a/test/psxy/bezvec.sh +++ b/test/psxy/bezvec.sh @@ -10,11 +10,11 @@ gmt psxy points -JQ180/57.5/6i -R160/200/50/65 -W0.1c,blue+s+ve0.4c -A -Bx10 -By gmt psxy points -J -R -W2p,black+s+ve0.4c -P -K -O >> $ps gmt psxy points -J -R -W0.5p,red+ve0.4c -A -P -K -O >> $ps gmt psxy points -J -R -W0.5p,pink+s -P -K -O >> $ps -gmt psxy points -J -R -Sx0.5c -W1p,green -P -O -K >> $ps +gmt psxy points -J -R -Sx0.5c -Ggreen -P -O -K >> $ps # Resampled gmt sample1d -I200k -AR points > p.txt gmt psxy p.txt -J -R -W0.1c,blue+s+ve0.4c -A -Bx10 -By5 -BswNE -O -K -Y5i >> $ps gmt psxy p.txt -J -R -W2p,black+s+ve0.4c -P -K -O >> $ps gmt psxy p.txt -J -R -W0.5p,red+ve0.4c -A -P -K -O >> $ps gmt psxy p.txt -J -R -W0.5p,pink+s -P -K -O >> $ps -gmt psxy p.txt -J -R -Sx0.5c -W1p,green -P -O >> $ps +gmt psxy p.txt -J -R -Sx0.5c -Ggreen -P -O >> $ps From 1587b7260e7f81fbe3c1717da349e3ebb1ee6290 Mon Sep 17 00:00:00 2001 From: Paul Wessel Date: Thu, 7 Sep 2023 12:11:39 +0200 Subject: [PATCH 13/18] Update images.dvc --- doc/examples/images.dvc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/examples/images.dvc b/doc/examples/images.dvc index 1db54129ef6..68eb9652eaa 100644 --- a/doc/examples/images.dvc +++ b/doc/examples/images.dvc @@ -1,5 +1,5 @@ outs: -- md5: 27ac0ad4e1c96b09b75e3f2d5270afca.dir - size: 35068257 +- md5: bce133098e623506af4a3ad63beaf4fe.dir + size: 35068306 nfiles: 53 path: images From b628aea6b13d73da56a2876dd85dbc0232b85ec9 Mon Sep 17 00:00:00 2001 From: Paul Wessel Date: Fri, 8 Sep 2023 12:09:58 +0200 Subject: [PATCH 14/18] fix output name and 2 PS files --- doc/scripts/images.dvc | 4 ++-- test/baseline/movie.dvc | 4 ++-- test/psevents/event_lines.sh | 2 +- test/psxy/gallo.sh | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/doc/scripts/images.dvc b/doc/scripts/images.dvc index 9f2bd9ffe1e..f2e7bab4500 100644 --- a/doc/scripts/images.dvc +++ b/doc/scripts/images.dvc @@ -1,5 +1,5 @@ outs: -- md5: 09ff36fa8f9eac3d342863ddbcbc5890.dir - size: 33329641 +- md5: 77b54cbc572ad83c1b88c3e010bb0c84.dir + size: 33329649 nfiles: 201 path: images diff --git a/test/baseline/movie.dvc b/test/baseline/movie.dvc index 39d64933162..7c6e8a3e84d 100644 --- a/test/baseline/movie.dvc +++ b/test/baseline/movie.dvc @@ -1,5 +1,5 @@ outs: -- md5: 73cc6f5c09f4c6490d1fde2a71bbd36f.dir - size: 267202 +- md5: 4f7fc65ff9890ee6b4e5fbddfaff26f8.dir + size: 267193 nfiles: 8 path: movie diff --git a/test/psevents/event_lines.sh b/test/psevents/event_lines.sh index e2803ea8316..54c30a4f9f6 100755 --- a/test/psevents/event_lines.sh +++ b/test/psevents/event_lines.sh @@ -22,7 +22,7 @@ cat << EOF > /tmp/def 3 0 5 0 EOF -gmt begin lines png +gmt begin event_lines ps gmt subplot begin 3x1 -Fs15c/5c -R-2/5/-1/2.5 -Bafg1 -A+jTL+gwhite+p1p gmt subplot set 0 -ALinear gmt plot psevents_function_l.txt -W3p,red -i0,1 -lsize diff --git a/test/psxy/gallo.sh b/test/psxy/gallo.sh index f587a56e053..cf66d54945e 100755 --- a/test/psxy/gallo.sh +++ b/test/psxy/gallo.sh @@ -16,5 +16,5 @@ EOF gmt psxy -Skgallo -R-45/0/0/70 -JX15c/0 -B5 -BWSen -P -K chicks.txt -Xc > $ps awk '{printf "%s %s %s %g%s\n", $1, $2, $3, substr($3,1,1)*'"$scale"', substr($3,2,1)}' chicks.txt > r.txt gmt psxy -R -J -O -K r.txt -Sr -Wfaint,blue >> $ps -gmt psxy -R -J -O -K chicks.txt -S+4i -Wfaint,red >> $ps +gmt psxy -R -J -O -K chicks.txt -S+4i -Wfaint -Gred >> $ps gmt psxy -R -J -O chicks.txt -Sc0.1i -Gyellow -Wthin >> $ps From 8f3cf8a879e8b72f1e819291354d212f66063004 Mon Sep 17 00:00:00 2001 From: Paul Wessel Date: Fri, 8 Sep 2023 12:17:04 +0200 Subject: [PATCH 15/18] Update psevents.dvc --- test/baseline/psevents.dvc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/baseline/psevents.dvc b/test/baseline/psevents.dvc index 4a15c1ad0a2..9ab66cd0646 100644 --- a/test/baseline/psevents.dvc +++ b/test/baseline/psevents.dvc @@ -1,5 +1,5 @@ outs: -- md5: b909bda59bb25ef7a68fddc6d00c173d.dir - size: 277203 - nfiles: 6 +- md5: 62cbdd1fa8eb8d749fb51b04a4a1bfd1.dir + size: 328668 + nfiles: 7 path: psevents From 904301f196f36eabb0ebf45e3548138fa6a950b5 Mon Sep 17 00:00:00 2001 From: Paul Wessel Date: Fri, 8 Sep 2023 16:32:03 +0200 Subject: [PATCH 16/18] Fix inverted CPT --- doc/scripts/GMT_seamount_density.sh | 2 +- doc/scripts/images.dvc | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/scripts/GMT_seamount_density.sh b/doc/scripts/GMT_seamount_density.sh index 6a87ac1b4f2..bb523cae061 100755 --- a/doc/scripts/GMT_seamount_density.sh +++ b/doc/scripts/GMT_seamount_density.sh @@ -2,7 +2,7 @@ # Show the seamount density model offered in grdseamount gmt begin GMT_seamount_density echo 0 0 50 6000 | gmt grdseamount -H6000/2500/3000+p1+d0 -Kmodel.grd -Cc -F0.2 - gmt makecpt -Cbilbao -T2500/3000 --COLOR_NAN=white + gmt makecpt -Cbilbao -T2500/3000 -I --COLOR_NAN=white # Plot density reference model above gmt grdimage model.grd -R0/1.1/0/1.3 -JX15c/4c -Bxaf+l"Normalized radial distance, @%6%r@%%" -Byafg1+l"Normalized height, @%6%h(r)@%%" printf "0 1.25\n1 0\n" | gmt plot -W0.25p,- diff --git a/doc/scripts/images.dvc b/doc/scripts/images.dvc index f2e7bab4500..df941834601 100644 --- a/doc/scripts/images.dvc +++ b/doc/scripts/images.dvc @@ -1,5 +1,5 @@ outs: -- md5: 77b54cbc572ad83c1b88c3e010bb0c84.dir - size: 33329649 +- md5: 82ec00d385cbf7aaa26287267668ef24.dir + size: 33329800 nfiles: 201 path: images From 85c106b19281e0cb36da2ff3c3b43a7c0c8b4ef9 Mon Sep 17 00:00:00 2001 From: Paul Wessel Date: Fri, 8 Sep 2023 16:47:02 +0200 Subject: [PATCH 17/18] Increase RMS threshold due to architectures --- test/grdvector/bothg.sh | 3 +++ test/psxy/decoratedlines.sh | 3 +++ 2 files changed, 6 insertions(+) diff --git a/test/grdvector/bothg.sh b/test/grdvector/bothg.sh index 43998168745..83fee375472 100755 --- a/test/grdvector/bothg.sh +++ b/test/grdvector/bothg.sh @@ -1,6 +1,9 @@ #!/usr/bin/env bash # Test to deal with issue http://gmt.soest.hawaii.edu/boards/1/topics/6311?r=6315#message-6315 # +# Due to hairline differences due to arcm64 macOS and Intel we need a +# higher rms threshold for this test to pass +# GRAPHICSMAGICK_RMS = 0.04 # GMT_KNOWN_FAILURE_WINDOWS # ps=bothg.ps diff --git a/test/psxy/decoratedlines.sh b/test/psxy/decoratedlines.sh index 6f844011743..1ec66437c48 100755 --- a/test/psxy/decoratedlines.sh +++ b/test/psxy/decoratedlines.sh @@ -1,5 +1,8 @@ #!/usr/bin/env bash # Place 7 decorated lines with symbols along them +# Due to hairline differences due to arcm64 macOS and Intel we need a +# higher rms threshold for this test to pass +# GRAPHICSMAGICK_RMS = 0.04 ps=decoratedlines.ps cat << EOF > vert.txt 90 0 From f2308250cfaf9824429a8e27f7594843379e8f42 Mon Sep 17 00:00:00 2001 From: Paul Wessel Date: Sat, 9 Sep 2023 00:34:13 +0200 Subject: [PATCH 18/18] typos running spellchecker --- test/psxy/vector2d_mods.sh | 6 +++--- test/psxyz/vector3d_mods.sh | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/test/psxy/vector2d_mods.sh b/test/psxy/vector2d_mods.sh index 4a390ec5621..4fa5a464f1e 100755 --- a/test/psxy/vector2d_mods.sh +++ b/test/psxy/vector2d_mods.sh @@ -57,13 +57,13 @@ gmt begin vector2d_mods # Direction, length given as 100kÏ echo 0 2 60 100k | gmt plot -S=20p+e -W2p -Gred echo "-0.1 2.9 Input: 60 100k Vector: -S=20p+e" | gmt text $textopt - # dx_km, dy_km to mimick the same + # dx_km, dy_km to mimic the same echo 0 3 ${dx_km} ${dy_km} | gmt plot -S=20p+e+z -W2p -Gred echo "-0.1 3.9 Input: ${dx_km} ${dy_km} Vector: -S=20p+e+z" | gmt text $textopt - # dx_km, dy_km to mimick the same but with unit + # dx_km, dy_km to mimic the same but with unit echo 0 4 ${dx_km}k ${dy_km}k | gmt plot -S=20p+e+z -W2p -Gred echo "-0.1 4.9 Input: ${dx_km}k ${dy_km}k Vector: -S=20p+e+z" | gmt text $textopt - # dx_km, dy_km to mimick the same + # dx_km, dy_km to mimic the same echo 0 5 ${dx_n}n ${dy_n}n | gmt plot -S=20p+e+z -W2p -Gred echo "-0.1 5.9 Input: ${dx_n}n ${dy_n}n Vector: -S=20p+e+z" | gmt text $textopt # dx, dy in specific data units with scale diff --git a/test/psxyz/vector3d_mods.sh b/test/psxyz/vector3d_mods.sh index 67cb268e75c..ea500d5ac65 100755 --- a/test/psxyz/vector3d_mods.sh +++ b/test/psxyz/vector3d_mods.sh @@ -57,13 +57,13 @@ gmt begin vector3d_mods # Direction, length given as 100kÏ echo 0 2 0 60 100k | gmt plot3d -S=20p+e -W2p -Gred echo "-0.1 2.9 Input: 60 100k Vector: -S=20p+e" | gmt text $textopt - # dx_km, dy_km to mimick the same + # dx_km, dy_km to mimic the same echo 0 3 0 ${dx_km} ${dy_km} | gmt plot3d -S=20p+e+z -W2p -Gred echo "-0.1 3.9 Input: ${dx_km} ${dy_km} Vector: -S=20p+e+z" | gmt text $textopt - # dx_km, dy_km to mimick the same but with unit + # dx_km, dy_km to mimic the same but with unit echo 0 4 0 ${dx_km}k ${dy_km}k | gmt plot3d -S=20p+e+z -W2p -Gred echo "-0.1 4.9 Input: ${dx_km}k ${dy_km}k Vector: -S=20p+e+z" | gmt text $textopt - # dx_km, dy_km to mimick the same + # dx_km, dy_km to mimic the same echo 0 5 0 ${dx_n}n ${dy_n}n | gmt plot3d -S=20p+e+z -W2p -Gred echo "-0.1 5.9 Input: ${dx_n}n ${dy_n}n Vector: -S=20p+e+z" | gmt text $textopt # dx, dy in specific data units with scale