How do I make surface plots with many NaN's in my matrix?
68 views (last 30 days)
Show older comments
Alex Foster
on 13 Mar 2019
Commented: Star Strider
on 13 Mar 2019
So I have a matrix of data that I'm trying to plot on the z-axis of a surface plot. However, it is populated with NaN's where I do not want data points to be plotted. This results in surface plots that look like this:
It looks like a surface should fit over those points, but surf is having a hard time filling in the areas with color. I'm doing
surf(p1,q1,F1,'EdgeColor','interp','FaceColor','interp')
where F1 is my matrix with NaN's. Any ideas on how to make this work?
0 Comments
Accepted Answer
Star Strider
on 13 Mar 2019
The fillmissing (link) function may be what you want. See specifically Matrix with Missing Endpoints (link).
2 Comments
More Answers (0)
See Also
Categories
Find more on Surface and Mesh Plots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!