I’m wondering how to remove the border line in my contour line. Basically, I want the color variation to be smooth and not separated by these line.
x1=[1.3, 1.76];
y1=[271, 241];
[xx1, yy1] = meshgrid(x1, y1);
z1=[3.3,3.7;3.7,3.3];
figure(1)
contourf(xx1,yy1,z1)
caxis ([3.3,3.7])
colormap(jet)
hcb=colorbar;
grid off;

답변 (2개)

Ankit
Ankit 2019년 9월 20일

2 개 추천

hello,
you need to set the edgecolor property to none.
x1=[1.3, 1.76];
y1=[271, 241];
[xx1, yy1] = meshgrid(x1, y1);
z1=[3.3,3.7;3.7,3.3];
figure(1)
contourf(xx1,yy1,z1,'edgecolor','none')
caxis ([3.3,3.7])
colormap(jet)
hcb=colorbar;
grid off;
Regards
Ankit

댓글 수: 2

Talal Salem
Talal Salem 2019년 9월 23일
I think using surf command will solve the problem.
Thank you.
Ankit
Ankit 2019년 9월 23일
Have you tried the above code?. It is working for me!

댓글을 달려면 로그인하십시오.

Akira Agata
Akira Agata 2019년 9월 20일

1 개 추천

How about using surf function with 'FaceColor' = 'interp' option, instead.
Here is an example.
figure
surf(xx1,yy1,z1,'FaceColor','interp')
colormap(jet)
colorbar;
view(2)
ax = gca;
ax.XLim = x1;
ax.YLim = fliplr(y1); % since y1(1) > y1(2)
surf.png

댓글 수: 1

Talal Salem
Talal Salem 2019년 9월 23일
편집: Talal Salem 2019년 9월 23일
Thanks a lot, that was very helpful.

댓글을 달려면 로그인하십시오.

카테고리

태그

질문:

2019년 9월 20일

편집:

2019년 9월 23일

Community Treasure Hunt

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

Start Hunting!

Translated by