Contourf fill color in bounded regions

4 views (last 30 days)
Jonathan
Jonathan on 2 Mar 2014
Commented: Jonathan on 2 Mar 2014
Hi,
I have a contour plot (attached) for which I need filled contours, so I'm using contourf. This has worked for me really well until recently, when I found that our newest data effectively enclosed a region of NaNs that then became--instead of white or transparent--red, the lowest color on my color axis. I'd like to be able to change this value to white if possible. Can anyone advise on how to do this? Similar questions on the Mathworks website didn't quite have the right answer for my purposes.
My code for the second of the five panels in the attached is a bit messy, but the gist of it is simply:
contourf(X,Y, Z,'*','EdgeColor','none);
Thanks in advance.
  1 Comment
Jonathan
Jonathan on 2 Mar 2014
From Matlab-related website:
"Contourf has a longstanding bug in handling internal masked regions; I hope you don't run into it. Both Mike D and I have tried to figure out how to fix that bug, but so far without success."
This appears to be what I'm seeing, so I'm hoping someone has experience overcoming this? If not I'll have to remove a few pixels from the matrix I use to populate the plot so that it doesn't interpret the masked internal areas as internal... That's a non-ideal clunky solution, though, since I'll have to do so manually every time I get new output.

Sign in to comment.

Answers (0)

Categories

Find more on Contour Plots in Help Center and File Exchange

Products

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!