# How to set the colors of NaN with grdview?

**URL:** <https://forum.generic-mapping-tools.org/t/how-to-set-the-colors-of-nan-with-grdview/4608>\
**Category:** Q&A\
**Created:** [January 16, 2024, 1:44pm UTC](https://forum.generic-mapping-tools.org/t/how-to-set-the-colors-of-nan-with-grdview/4608 "2024-01-16T13:44:57Z")\
**Posts on this page:** 1\
**Showing post:** 8

<div class="post-metadata">

**Author:** ![pwessel](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/pwessel/32/30_2.png) [@pwessel](https://forum.generic-mapping-tools.org/u/pwessel)\
**Post date:** [January 17, 2024, 9:45am UTC](https://forum.generic-mapping-tools.org/t/how-to-set-the-colors-of-nan-with-grdview/4608/8 "2024-01-17T09:45:46Z")

</div>

The issue of using NaN colors in **grdview** is probably something that could be improved and revisited. Right now, I get read NaNs only with **-Qs** (surface) and only without **-p**. This is due to various if-test checks. For **-Q** we rasterize the grid to an image and set the image pixels to whatever color (but not the NaN color).

I suspect we will need a modifier or option to insist that we use the NaN color, whatever it is, on the NaN pixels or NaN nodes or NaN patches. Perhaps the simplest syntax might be a new modifier **+n** to **-Q** which says "paint any NaN node or pixel with the NaN color in the CPT (requires **-C** )?

---

_[View the full topic](https://forum.generic-mapping-tools.org/t/how-to-set-the-colors-of-nan-with-grdview/4608)._
