Blank faces in surface plot

2 views (last 30 days)
Gautam Marwaha
Gautam Marwaha on 16 Apr 2014
Edited: Gautam Marwaha on 16 Apr 2014
Hi,
I have non-uniformly spaced data and am using meshgrid, griddata & surf to obtain a surface plot. Since my data has discontinuities, I would like to have the plot show an empty face corresponding to those coordinates. Is there a way to do that? My current code is as below:
xlin = linspace(min(x),max(x),300);
ylin = linspace(min(y),max(y),150);
[X,Y] = meshgrid(xlin,ylin);
Z = griddata(x,y,z,X,Y,'cubic');
figure;
surf(X,Y,Z);
Discontinuities in my function values (z) are represented by NaN. For eg. at x = 1650, y = 150, z is set as NaN to represent a discontinuity.
Thanks!

Answers (0)

Products

Community Treasure Hunt

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

Start Hunting!