why surface plot is connecting its edges?
Show older comments
I need to create a 4d plot and am using the surf plot with the colors being the 4th dimension of the graph, however, for some data sets the edges of the surface is connecting together as can be seen in the first image, the second image uses the same script but it does not connect the edges. Any help will be very appreciated.


5 Comments
Walter Roberson
on 9 Jan 2021
Your Current data appears to loop back to the beginning.
Wilson Duarte
on 10 Jan 2021
Image Analyst
on 10 Jan 2021
I don't think that is your whole program. For example there is nothing there that created the legend or labeled the axes. So some code is missing. Please post your whole program.
Your x does recycle
T = readtable('data_surf.xlsx');
T.Properties.VariableNames = {'x', 'y', 'v'};
plot(T.x)
minx = min(T.x);
maxx = max(T.x);
miny = min(T.y);
maxy = max(T.y);
xvec = linspace(minx, maxx);
yvec = linspace(miny, maxy);
[X,Y] = ndgrid(xvec, yvec);
F = scatteredInterpolant(T.x, T.y, T.v);
V = F(X,Y);
surf(X, Y, V, 'edgecolor', 'none')
Wilson Duarte
on 10 Jan 2021
Edited: Wilson Duarte
on 10 Jan 2021
Accepted Answer
More Answers (0)
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!

