GenericMappingTools / GenericMappingTools/gmt
Ability topping NaN nodes/pixels in grdview with the NaN color
- Dominant language
- C
- Stars
- 979
- Forks
- 414
- Avg merge
- 17h 26m
- Merged PRs (30d)
- 54
Description
See the forum [post](https://forum.generic-mapping-tools.org/t/how-to-set-the-colors-of-nan-with-grdview/4608/8) for background.
Apparently, **grdview** can only paint nodes with the NaN colour for **-Qs** (surface) and when the 3D vantage point **-p**_az_/_el_ is not used. This seems unnecessarily restrictive for no good reason and probably hails back to the GMT4 days. My proposal to improve this involves a new modifier to **-Q**. New syntax (and improved layout for all):
**-Qc**|**i**|**m**[**x**|**y**][_color_]|**s**[**m**][**+m**][**+n**]
Select among the following directives **c i m** or **s**:
- Specify **c**. Same as **-Qi** but will make pixels with z = NaN transparent, using the colormasking
feature in PostScript Level 3 (the PS device must support PS Level 3).
- Specify **i** for image plot, and optionally append the effective dots-per-unit resolution for the rasterization [Default is **GMT_GRAPHICS_DPU**].
- Specify **m** for mesh plot [**Default**], and optionally append *color* for a different mesh paint [white].
- Specify **mx** or **my** for waterfall plots (row or column profiles). Optionally, append _color_ as for plain **m**.
- Specify **s** for surface plot coloured by the CPT, and optionally append **m** to have mesh lines drawn on top of surface (use **-Wm**_pen_ to set specific mesh pen).
**Note**: If the CPT is categorical then only **-Qm** is available (but see **-T**).
Optional modifiers:
- **+m** - Force a monochrome image. Colors are then converted to shades of gray using the (monochrome television) YIQ transformation
- **+n** - Force colorisation of NaN nodes or pixels via the NaN CPT or default colour. **PROPOSED**.
One question is if we leave the NaN colour default for **-Qs** or if that also needs **+n**? Probably for backwards compatible reasons we should leave it?
Contributor guide
Assessment
This issue has not been assessed yet.