Contourf fill color in bounded regions

6 次查看(过去 30 天)
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 个评论
Jonathan
Jonathan 2014-3-2
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.

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Contour Plots 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by