From 886a02d8fffa4c9b553cad46a2f858fdb6f747ba Mon Sep 17 00:00:00 2001 From: Joaquim Date: Mon, 5 Jan 2026 19:53:22 +0000 Subject: [PATCH 1/3] Fix a regression that was causing failure of categorical test. Also document -Qt option that was missing since its creation. --- doc/rst/source/grdview.rst | 18 ++++++++++-------- src/grdview.c | 14 +++++++------- 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/doc/rst/source/grdview.rst b/doc/rst/source/grdview.rst index 45425e56213..d8c3d05ef86 100644 --- a/doc/rst/source/grdview.rst +++ b/doc/rst/source/grdview.rst @@ -19,7 +19,7 @@ Synopsis [ |-I|\ [*file*\|\ *intens*\|\ **+a**\ *azimuth*][**+d**][**+m**\ *ambient*][**+n**\ *args*] ] [ |-Jz|\ \|\ **Z**\ *parameters* ] [ |-N|\ [*level*]\ [**+g**\ *fill*] ] -[ |-Q|\ **c**\|\ **i**\|\ **m**\ [**x**\|\ **y**]\|\ **s**\ [**m**]\|\ **g**\ [**m**]\ [*color*][**+m**] ] +[ |-Q|\ **c**\|\ **g**\ [**m**]\ **i**\|\ **m**\ [**x**\|\ **y**]\|\ **s**\ [**m**]\|\ [*color*][**+m**]\ **t** ] [ |SYN_OPT-Rz| ] [ |-S|\ *smooth* ] [ |-T|\ [**+o**\ [*pen*]][**+s**] ] @@ -101,24 +101,26 @@ Optional Arguments .. _-Q: -**-Q**\ **c**|\ **g**[**m**][**a**]|\ **i**|\ **m**\ [**x**|\ **y**]|\ **s**\ [**m**]\ [*color*][**+m**] +**-Q**\ **c**\|\ **g**\ [**m**]\ **i**\|\ **m**\ [**x**\|\ **y**]\|\ **s**\ [**m**]\|\ [*color*][**+m**]\ **t** Select one of following directives. For any of these choices: - **c** - Image plot, but will make nodes with *z* = NaN transparent, using the color-masking feature in PostScript Level 3. Optionally append the effective dots-per-unit resolution for the rasterization [Default is :term:`GMT_GRAPHICS_DPU`]. - - **i** - Image plot. Optionally append the effective dots-per-unit resolution for the - rasterization [Default is :term:`GMT_GRAPHICS_DPU`]. - - **m** - Mesh plot [Default]. Optionally append *color* for a different mesh paint [white]. - For waterfall plots, append **x** for row or **y** for column profiles. Specify color as for plain **m**. - - **s** - Surface plot. Optionally append **m** to have mesh lines drawn on top of surface. See **-Wm** for - setting a specific mesh *pen*. - **g** - Gouraud-shaded surface with smooth vertex-based color gradients. Optionally append **m** to draw mesh lines on top of the surface. Append **a** to use alternate diagonal when splitting tiles into triangles. Gouraud shading produces smoother color transitions than **-Qs** and generates significantly smaller and faster PostScript files. The **-Qs** option should be used though when precise color transitions are required at contour levels (to do a `contourf` type figure. See **-Wc**) because the Gouraud-shaded doesn't cut the tiles along the contour lines as **-Qs** does. + - **i** - Image plot. Optionally append the effective dots-per-unit resolution for the + rasterization [Default is :term:`GMT_GRAPHICS_DPU`]. + - **m** - Mesh plot [Default]. Optionally append *color* for a different mesh paint [white]. + For waterfall plots, append **x** for row or **y** for column profiles. Specify color as for plain **m**. + - **s** - Surface plot. Optionally append **m** to have mesh lines drawn on top of surface. See **-Wm** for + setting a specific mesh *pen*. + - **t** - Paint tiles without color interpolation. Good for categorical data. Optionally append the effective + dots-per-unit resolution for the rasterization [Default is :term:`GMT_GRAPHICS_DPU`]. A modifier can adjust the color further: diff --git a/src/grdview.c b/src/grdview.c index c4d8977c8e1..9842641dab1 100644 --- a/src/grdview.c +++ b/src/grdview.c @@ -504,7 +504,7 @@ static int usage (struct GMTAPI_CTRL *API, int level) { const char *name = gmt_show_name_and_purpose (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_PURPOSE); if (level == GMT_MODULE_PURPOSE) return (GMT_NOERROR); GMT_Usage (API, 0, "usage: %s %s [%s] [-C%s] [-G|] " - "[-I[||]] [%s] %s[-N[][+g]] %s%s[-Qc|i|m[x|y]|s[][+m]] [%s] [-S] " + "[-I[||]] [%s] %s[-N[][+g]] %s%s[-Qc|g[m|a]|i|m[x|y]|s[][+m]] [%s] [-S] " "[-T[+o[]][+s]] [%s] [%s] [-W] [%s] [%s] %s[%s] [%s] [%s] [%s] [%s]\n", 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, 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) { GMT_Usage (API, 3, "c: Transform polygons to raster-image via scanline conversion. Append effective [%lg%c]. " "Set PS Level 3 color-masking for nodes with z = NaN.", API->GMT->current.setting.graphics_dpu, API->GMT->current.setting.graphics_dpu_unit); + 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."); GMT_Usage (API, 3, "i: As c but no color-masking. Append effective [%lg%c].", API->GMT->current.setting.graphics_dpu, API->GMT->current.setting.graphics_dpu_unit); GMT_Usage (API, 3, "m: Mesh plot [Default]. Append for mesh paint [%s]. " "Alternatively, append x or y for row or column \"waterfall\" profiles.", gmt_putcolor (API->GMT, API->GMT->PSL->init.page_rgb)); GMT_Usage (API, 3, "s: Colored or shaded surface. Optionally, append m to draw mesh-lines on the surface."); - 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."); + GMT_Usage (API, 3, "t: Paint tiles without color interpolation. Good for categorical data."); GMT_Usage (API, -2, "Color may be further adjusted by a modifier:"); GMT_Usage (API, 3, "+m Force a monochrome image using the YIQ transformation."); GMT_Option (API, "R"); @@ -733,10 +734,6 @@ static int parse (struct GMT_CTRL *GMT, struct GRDVIEW_CTRL *Ctrl, struct GMT_OP Ctrl->Q.cpt = true; /* Will need a CPT */ Ctrl->Q.mask = true; break; - case 't': /* Image without color interpolation */ - Ctrl->Q.special = true; - Ctrl->Q.cpt = true; /* Will need a CPT */ - /* Intentionally fall through - to 'i' */ case 'g': /* Gouraud-shaded surface */ Ctrl->Q.mode = GRDVIEW_SURF; Ctrl->Q.gouraud = true; @@ -744,9 +741,12 @@ static int parse (struct GMT_CTRL *GMT, struct GRDVIEW_CTRL *Ctrl, struct GMT_OP if (opt->arg[1] == 'm') Ctrl->Q.outline = 1; if (opt->arg[1] == 'a') Ctrl->Q.diagonal = 1; break; + case 't': /* Image without color interpolation */ + Ctrl->Q.special = true; + /* Intentionally fall through - to 'i' */ case 'i': /* Image with clipmask */ Ctrl->Q.mode = GRDVIEW_IMAGE; - if (opt->arg[1] && isdigit ((int)opt->arg[1])) Ctrl->Q.dpi = grdview_get_dpi (&opt->arg[1]); + if (opt->arg[1] && isdigit((int)opt->arg[1])) Ctrl->Q.dpi = grdview_get_dpi(&opt->arg[1]); Ctrl->Q.cpt = true; /* Will need a CPT */ break; case 'm': /* Mesh plot */ From b8caef6d9320d515fd8f8390159e1e264cf1fb6a Mon Sep 17 00:00:00 2001 From: Joaquim Date: Mon, 5 Jan 2026 20:38:41 +0000 Subject: [PATCH 2/3] Trythis to see if CI on MacOS run again. --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 97a915fe6c1..49632eff308 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -54,7 +54,7 @@ jobs: - name: Linux os: ubuntu-latest - name: macOS - os: macos-latest + os: macos-15-intel - name: Windows os: windows-latest - name: Linux (without optional dependencies) From 8d53ecbe280d65da0d2a81024f517e4ff9c89fca Mon Sep 17 00:00:00 2001 From: Joaquim Date: Mon, 5 Jan 2026 20:46:19 +0000 Subject: [PATCH 3/3] Now try this one --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 43dd912447d..2af3c76e1b2 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -54,7 +54,7 @@ jobs: - name: Linux os: ubuntu-latest - name: macOS - os: macos-13 # macos-14 use M1 chips, which causes many failures + os: macos-15-intel # macos-14 use M1 chips, which causes many failures - name: Windows os: windows-latest