Menu

#233 color for NaN values in image plot

closed-works-for-me
nobody
None
5
2009-03-29
2009-03-14
hmoto
No

In the plotting with image of the data includes NaN values,
the grids have NaN value are drawn in the color of the lowest value defined in cbrange.

It may be useful that there is the option to specify
the color for NaN or transparency in image plot.

If the NaN values are not drawn,
it is possible to overlaying the some image plots.

Thanks.

Discussion

  • Ethan Merritt

    Ethan Merritt - 2009-03-14

    This is already implemented in the CVS version of gnuplot. You can either let the NaN value create an out-of-range pixel value or by explicitly trap it and assign an alpha value of 0 to an RGBA image.

    For a simple example, start with one of the plots in "heatmaps.dem" and replace one of the matrix elements with NaN.

    The external opitimized image handling performed for instance by PostScript may not support this however. In this case you can add the keyword "failsafe" to your plot command ( 'plot .... with image failsafe' ). This will cause gnuplot to use generic code to draw each pixel, and this generic code will definitely omit pixels with NaN value. But the output file may be larger than for the terminal-specific optimization.

     
  • Ethan Merritt

    Ethan Merritt - 2009-03-14
    • status: open --> pending-works-for-me
     
  • hmoto

    hmoto - 2009-03-14

    After reading your comment, I tried CVS version.

    It solves the almost of my problem in using image style.
    The pngcairo terminal did not require the failsafe keyword
    to make transparent the NaN grids, and x11 terminal required.

    Thank you very match.

    If you don't mind my asking, is there a way to fill NaN grids in the
    specified color (e.g. gray) and to draw the valid grids
    in normal pm3d colors in image style ?

     
  • SourceForge Robot

    This Tracker item was closed automatically by the system. It was
    previously set to a Pending status, and the original submitter
    did not respond within 14 days (the time period specified by
    the administrator of this Tracker).

     
  • SourceForge Robot

    • status: pending-works-for-me --> closed-works-for-me
     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.