How to have different styles of mesh for matlab surfaces?
조회 수: 3 (최근 30일)
이전 댓글 표시
Hi guys,
I have the below three test surfaces. I want each of the three surfaces to have the same color, but I want them distinguished based on different mesh style or line style or pattern? is it possible?
Thank you
x = [0:0.50:5];
y = {0:0.50:2; 2:0.50:3.5; 3.5:0.50:5};
Test1 = @(x,y)(x+y);
Test2 = @(x,y)(2.*x+y);
Test3 = @(x,y)(3.*x+y);
[X1,Y1] = meshgrid(x,y{1});
[X2,Y2] = meshgrid(x,y{2});
[X3,Y3] = meshgrid(x,y{3});
Z1 = Test1(X1,Y1);
Z2 = Test2(X2,Y2);
Z3 = Test3(X3,Y3);
figure(1)
s1 = surf(X1,Y1,Z1);
hold on
s2 = surf(X2,Y2,Z2);
s3 = surf(X3,Y3,Z3);
hold off
set(s1,'FaceColor',[0.9 1 1],'edgecolor',[0.9 1 1]);
set(s2,'FaceColor',[0.9 1 1],'edgecolor',[0.9 1 1]);
set(s3,'FaceColor',[0.9 1 1],'edgecolor',[0.9 1 1]);
댓글 수: 0
답변 (1개)
pfb
2015년 4월 27일
uhm, mesh style should be easy, provided you do not use the same color for the faces and the mesh. I'm using black here.
set(s1,'FaceColor',[0.9 1 1],'edgecolor',[0 0 0],'LineStyle','-');
set(s2,'FaceColor',[0.9 1 1],'edgecolor',[0 0 0],'LineStyle','--');
set(s3,'FaceColor',[0.9 1 1],'edgecolor',[0 0 0],'LineStyle',':');
댓글 수: 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!