contour plotting in matlab
이전 댓글 표시
Hi
I have plotted a scattered plot and a contour plot (figure attached below). However, the contour plot has unusual curvy edges as marked in the figure. How to avoid these curvy edges and make a smooth color variation.


댓글 수: 5
Walter Roberson
2021년 6월 28일
After you interpolate, use a low-pass filter?
Bjorn Gustavsson
2021년 6월 28일
What did you see when you looked at the triangulation around one of the intersections between the circle-sections and the horizontal lines?
mukesh bisht
2021년 6월 28일
편집: Walter Roberson
2021년 6월 28일
Bjorn Gustavsson
2021년 6월 28일
You should first figure out why you get these "pricks" in the first place. Then figure out a way to handle that cause. Here's what you should do, explicitly.
On top of your scatterplot plot the edges of all the triangles created by the triangulation used by delaunay, which is used inside the griddata/scatteredinterpolant/triscatteredinterpolant functions, like this:
tri = delaunay(x,y);
clf
% Your call to scatter goes here
hold on
edges = [1 2;2 3;3 1];
for i1 = 1:size(tri,1)
for i2 = 1:3
h = plot(x(tri(i1,edges(i2,:))),y(tri(i1,edges(i2,:))),'b','linewidth',2);
drawnow
set(h,'linewidth',1)
end
end
Then you zoom in onto the edge between the "all-blue" circle-sectors and the lines - there you will see the cause of your problem.
Bjorn Gustavsson
2021년 6월 28일
Well I guess you could also go for a non-linear diffusion-filter but that will be for later when other means to handle your problem is exhausted.
답변 (0개)
카테고리
도움말 센터 및 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!
