Skip to content

Commit 9486343

Browse files
authored
Fix a regression that was causing failure of categorical test. (#8855)
* Fix a regression that was causing failure of categorical test. Also document -Qt option that was missing since its creation. * Trythis to see if CI on MacOS run again. * Now try this one
1 parent d516e67 commit 9486343

File tree

4 files changed

+19
-17
lines changed

4 files changed

+19
-17
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ jobs:
5454
- name: Linux
5555
os: ubuntu-latest
5656
- name: macOS
57-
os: macos-latest
57+
os: macos-15-intel
5858
- name: Windows
5959
os: windows-latest
6060
- name: Linux (without optional dependencies)

.github/workflows/tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ jobs:
5454
- name: Linux
5555
os: ubuntu-latest
5656
- name: macOS
57-
os: macos-13 # macos-14 use M1 chips, which causes many failures
57+
os: macos-15-intel # macos-14 use M1 chips, which causes many failures
5858
- name: Windows
5959
os: windows-latest
6060

doc/rst/source/grdview.rst

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Synopsis
1919
[ |-I|\ [*file*\|\ *intens*\|\ **+a**\ *azimuth*][**+d**][**+m**\ *ambient*][**+n**\ *args*] ]
2020
[ |-Jz|\ \|\ **Z**\ *parameters* ]
2121
[ |-N|\ [*level*]\ [**+g**\ *fill*] ]
22-
[ |-Q|\ **c**\|\ **i**\|\ **m**\ [**x**\|\ **y**]\|\ **s**\ [**m**]\|\ **g**\ [**m**]\ [*color*][**+m**] ]
22+
[ |-Q|\ **c**\|\ **g**\ [**m**]\ **i**\|\ **m**\ [**x**\|\ **y**]\|\ **s**\ [**m**]\|\ [*color*][**+m**]\ **t** ]
2323
[ |SYN_OPT-Rz| ]
2424
[ |-S|\ *smooth* ]
2525
[ |-T|\ [**+o**\ [*pen*]][**+s**] ]
@@ -101,24 +101,26 @@ Optional Arguments
101101

102102
.. _-Q:
103103

104-
**-Q**\ **c**|\ **g**[**m**][**a**]|\ **i**|\ **m**\ [**x**|\ **y**]|\ **s**\ [**m**]\ [*color*][**+m**]
104+
**-Q**\ **c**\|\ **g**\ [**m**]\ **i**\|\ **m**\ [**x**\|\ **y**]\|\ **s**\ [**m**]\|\ [*color*][**+m**]\ **t**
105105
Select one of following directives. For any of these choices:
106106

107107
- **c** - Image plot, but will make nodes with *z* = NaN transparent, using the color-masking
108108
feature in PostScript Level 3. Optionally append the effective dots-per-unit resolution
109109
for the rasterization [Default is :term:`GMT_GRAPHICS_DPU`].
110-
- **i** - Image plot. Optionally append the effective dots-per-unit resolution for the
111-
rasterization [Default is :term:`GMT_GRAPHICS_DPU`].
112-
- **m** - Mesh plot [Default]. Optionally append *color* for a different mesh paint [white].
113-
For waterfall plots, append **x** for row or **y** for column profiles. Specify color as for plain **m**.
114-
- **s** - Surface plot. Optionally append **m** to have mesh lines drawn on top of surface. See **-Wm** for
115-
setting a specific mesh *pen*.
116110
- **g** - Gouraud-shaded surface with smooth vertex-based color gradients. Optionally append **m** to draw mesh lines
117111
on top of the surface. Append **a** to use alternate diagonal when splitting tiles into triangles.
118112
Gouraud shading produces smoother color transitions than **-Qs** and generates significantly smaller
119113
and faster PostScript files. The **-Qs** option should be used though when precise color transitions
120114
are required at contour levels (to do a `contourf` type figure. See **-Wc**) because the Gouraud-shaded
121115
doesn't cut the tiles along the contour lines as **-Qs** does.
116+
- **i** - Image plot. Optionally append the effective dots-per-unit resolution for the
117+
rasterization [Default is :term:`GMT_GRAPHICS_DPU`].
118+
- **m** - Mesh plot [Default]. Optionally append *color* for a different mesh paint [white].
119+
For waterfall plots, append **x** for row or **y** for column profiles. Specify color as for plain **m**.
120+
- **s** - Surface plot. Optionally append **m** to have mesh lines drawn on top of surface. See **-Wm** for
121+
setting a specific mesh *pen*.
122+
- **t** - Paint tiles without color interpolation. Good for categorical data. Optionally append the effective
123+
dots-per-unit resolution for the rasterization [Default is :term:`GMT_GRAPHICS_DPU`].
122124

123125
A modifier can adjust the color further:
124126

src/grdview.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -504,7 +504,7 @@ static int usage (struct GMTAPI_CTRL *API, int level) {
504504
const char *name = gmt_show_name_and_purpose (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_PURPOSE);
505505
if (level == GMT_MODULE_PURPOSE) return (GMT_NOERROR);
506506
GMT_Usage (API, 0, "usage: %s <topogrid> %s [%s] [-C%s] [-G<drapegrid>|<drapeimage>] "
507-
"[-I[<intensgrid>|<value>|<modifiers>]] [%s] %s[-N[<level>][+g<fill>]] %s%s[-Qc|i|m[x|y]|s[<color>][+m]] [%s] [-S<smooth>] "
507+
"[-I[<intensgrid>|<value>|<modifiers>]] [%s] %s[-N[<level>][+g<fill>]] %s%s[-Qc|g[m|a]|i|m[x|y]|s[<color>][+m]] [%s] [-S<smooth>] "
508508
"[-T[+o[<pen>]][+s]] [%s] [%s] [-W<type><pen>] [%s] [%s] %s[%s] [%s] [%s] [%s] [%s]\n",
509509
name, GMT_J_OPT, GMT_B_OPT, CPT_OPT_ARGS, GMT_Jz_OPT, API->K_OPT, API->O_OPT, API->P_OPT, GMT_Rgeoz_OPT, GMT_U_OPT, GMT_V_OPT,
510510
GMT_X_OPT, GMT_Y_OPT, API->c_OPT, GMT_f_OPT, GMT_n_OPT, GMT_p_OPT, GMT_t_OPT, GMT_PAR_OPT);
@@ -542,13 +542,14 @@ static int usage (struct GMTAPI_CTRL *API, int level) {
542542
GMT_Usage (API, 3, "c: Transform polygons to raster-image via scanline conversion. Append effective <dpu> [%lg%c]. "
543543
"Set PS Level 3 color-masking for nodes with z = NaN.",
544544
API->GMT->current.setting.graphics_dpu, API->GMT->current.setting.graphics_dpu_unit);
545+
GMT_Usage (API, 3, "g: Gouraud-shaded surface with smooth vertex-based color gradients. Append m to draw mesh-lines. Append a for alternate diagonal algorithm.");
545546
GMT_Usage (API, 3, "i: As c but no color-masking. Append effective <dpu> [%lg%c].",
546547
API->GMT->current.setting.graphics_dpu, API->GMT->current.setting.graphics_dpu_unit);
547548
GMT_Usage (API, 3, "m: Mesh plot [Default]. Append <color> for mesh paint [%s]. "
548549
"Alternatively, append x or y for row or column \"waterfall\" profiles.",
549550
gmt_putcolor (API->GMT, API->GMT->PSL->init.page_rgb));
550551
GMT_Usage (API, 3, "s: Colored or shaded surface. Optionally, append m to draw mesh-lines on the surface.");
551-
GMT_Usage (API, 3, "g: Gouraud-shaded surface with smooth vertex-based color gradients. Append m to draw mesh-lines. Append a for alternate diagonal.");
552+
GMT_Usage (API, 3, "t: Paint tiles without color interpolation. Good for categorical data.");
552553
GMT_Usage (API, -2, "Color may be further adjusted by a modifier:");
553554
GMT_Usage (API, 3, "+m Force a monochrome image using the YIQ transformation.");
554555
GMT_Option (API, "R");
@@ -733,20 +734,19 @@ static int parse (struct GMT_CTRL *GMT, struct GRDVIEW_CTRL *Ctrl, struct GMT_OP
733734
Ctrl->Q.cpt = true; /* Will need a CPT */
734735
Ctrl->Q.mask = true;
735736
break;
736-
case 't': /* Image without color interpolation */
737-
Ctrl->Q.special = true;
738-
Ctrl->Q.cpt = true; /* Will need a CPT */
739-
/* Intentionally fall through - to 'i' */
740737
case 'g': /* Gouraud-shaded surface */
741738
Ctrl->Q.mode = GRDVIEW_SURF;
742739
Ctrl->Q.gouraud = true;
743740
Ctrl->Q.cpt = true; /* Will need a CPT */
744741
if (opt->arg[1] == 'm') Ctrl->Q.outline = 1;
745742
if (opt->arg[1] == 'a') Ctrl->Q.diagonal = 1;
746743
break;
744+
case 't': /* Image without color interpolation */
745+
Ctrl->Q.special = true;
746+
/* Intentionally fall through - to 'i' */
747747
case 'i': /* Image with clipmask */
748748
Ctrl->Q.mode = GRDVIEW_IMAGE;
749-
if (opt->arg[1] && isdigit ((int)opt->arg[1])) Ctrl->Q.dpi = grdview_get_dpi (&opt->arg[1]);
749+
if (opt->arg[1] && isdigit((int)opt->arg[1])) Ctrl->Q.dpi = grdview_get_dpi(&opt->arg[1]);
750750
Ctrl->Q.cpt = true; /* Will need a CPT */
751751
break;
752752
case 'm': /* Mesh plot */

0 commit comments

Comments
 (0)