How to make smoother surf plot
8 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Hi,
I got some troubles with having a smooth surf plot of some points of measurement (plot3 in 3D) to finally obtain a perfect looking contour plot. If someone could give me some advices it would be helpfull.
Please check the currents results and the code.
if true
figure
plot3(V1,T1,N1,'o')
xlabel('v')
ylabel('c')
zlabel('n')
title('')
rangeY=min(T1):55:max(T1);
rangeX=min(V1):55:max(V1);
[X,Y]=meshgrid(rangeX,rangeY);
Z = griddata(V1,T1,N1,X,Y,'cubic');
figure
surf(X,Y,Z);
rangeZ=floor(min(N1)):0.1:ceil(max(N1));
figure
hold all
contour(X,Y,Z,[0 0.1 0.2 0.3 0.4 0.5 1 2 3 4 5 6 7 8 9],'showtext','on');
% plot(v100,t100,'r','linewidth',3)
% plot(vNTE,tNTE,'r','linewidth',3)
set(gca,'xlim',[800 2400],'xtick',800:100:2400);
set(gca,'ylim',[0 2500],'ytick',0:200:2500);
xlabel('v');
ylabel('c');
zlabel('n')
title('')
end


bye
4 Commenti
jonas
il 8 Nov 2018
Modificato: jonas
il 8 Nov 2018
It's quite simple, but I can't tell if the results will be any good. I think griddata and/or interp2 supports extrapolation. I also don't know if I would propose it, however, because extrapolation is often tricky and unreliable. I'd give it a try if you upload the data.
If your main concern is the smoothness rather than the discontinuous edges, then I would just increase the resolution in your meshgrid call.
Risposte (1)
KSSV
il 8 Nov 2018
Read about griddata and scatteredinterpolant. YOu can do interpolation and generate the plot you want.
0 Commenti
Vedere anche
Categorie
Scopri di più su Surface and Mesh Plots in Help Center e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!