bugGNU Octave - Bugs: bug #58325, Document how NaN color value is...

 
 

bug #58325: Document how NaN color value is handled by imagesc

Submitter:  Guillaume <gyom>
Submitted:  Thu 07 May 2020 04:47:41 PM UTC
   
 
Category:  Documentation Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Documentation
Status:  Confirmed Assigned to:  None
Originator Name:  Guillaume Open/Closed:  * Open
Release:  * dev Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Tue 12 May 2020 10:14:03 PM UTC, comment #1: 

I think it would be fine to add documentation that Octave uses black for NaN values in imagesc.  Also, you might want to document the workaround of using pcolor.


pcolor (x)
shading interp
set (gca, 'color', DESIRED_COLOR_FOR_NAN_VALUES)



Rik <rik5>
Group administrator
Thu 07 May 2020 04:47:41 PM UTC, original submission:  

When displaying an image containing NaNs with imagesc, Octave displays them as black while Matlab uses the first color of the colormap.

I could find a related comment on the Octave Help mailing list:
https://lists.gnu.org/archive/html/help-octave/2018-10/msg00059.html
and it seems to be frequently mentioned by Matlab users:
https://stackoverflow.com/questions/14933039/matlab-imagesc-plotting-nan-values
https://stackoverflow.com/questions/8481324/contrasting-color-for-nans-in-imagesc
https://www.mathworks.com/matlabcentral/answers/373508-imagesc-how-to-set-nan-as-white-color
https://www.mathworks.com/matlabcentral/answers/81938-set-nan-as-another-color-than-default-using-imagesc

Now, the Matlab documentation says: "The behavior of NaN elements is not defined."
https://www.mathworks.com/help/matlab/ref/imagesc.html#buxkjup-2l
so there is no need to try and reproduce an undefined behavior. But could the documentation be updated to either say that the behavior is unpredictable or that a black color will be used?

Guillaume <gyom>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by gyom (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2020-05-17 rik5 CategoryPlotting with OpenGL Documentation
        Item GroupMatlab Compatibility Documentation
        StatusNone Confirmed
        SummaryNaN color with imagesc Document how NaN color value is handled by imagesc

    Back to the top

    Powered by Savane 3.13-758e.
    Corresponding source code