How to make smoother surf plot
조회 수: 8 (최근 30일)
이전 댓글 표시
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
jonas
2018년 11월 8일
편집: jonas
2018년 11월 8일
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.
답변 (1개)
KSSV
2018년 11월 8일
Read about griddata and scatteredinterpolant. YOu can do interpolation and generate the plot you want.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Surface and Mesh Plots에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!