Is it possible Matlab shows the grid on the surface of the plot?

조회 수: 26 (최근 30일)
Wajahat
Wajahat 2020년 4월 4일
답변: Walter Roberson 2020년 4월 4일
close all;
X=-10:.1:10;
T=-10:.1:10;
%i=1;
w0=1;
c=-1;
mu1=.4*1i;
a=2*mu1.^2-(2*w0.^2);
[x,t]=meshgrid(X,T);
u=2*(1i*mu1.*x-(1i*mu1*c./(a)).*t);
r1=-4*1i*mu1*sin(u);
surf(x,t,abs(r1));
shading flat;
%grid off;
view(-48,68)
Is it possible Matlab shows the grid on the surface of the plot? i.e.

답변 (2개)

KALYAN ACHARJYA
KALYAN ACHARJYA 2020년 4월 4일
편집: KALYAN ACHARJYA 2020년 4월 4일
Change the faceAlpha (within 0 and 1) value, see, it may heps you (This is transperancy)
surf(x,t,abs(r1),'FaceAlpha',0.5);
Or Try this one:
X=-10:.1:10;
T=-10:.1:10;
%i=1;
w0=1;
c=-1;
mu1=.4*1i;
a=2*mu1.^2-(2*w0.^2);
[x,t]=meshgrid(X,T);
u=2*(1i*mu1.*x-(1i*mu1*c./(a)).*t);
r1=-4*1i*mu1*sin(u);
h=surf(x,t,abs(r1));
shading interp;
set(h,'edgecolor','m')
% Similarly you can change the face color also for more visible.
view(-48,68)

Walter Roberson
Walter Roberson 2020년 4월 4일
X=-10:.1:10;
T=-10:.1:10;
%i=1;
w0=1;
c=-1;
mu1=.4*1i;
a=2*mu1.^2-(2*w0.^2);
[x,t]=meshgrid(X,T);
u=2*(1i*mu1.*x-(1i*mu1*c./(a)).*t);
r1=-4*1i*mu1*sin(u);
h = surf(x,t,abs(r1));
shading flat;
%grid off;
view(-48,68)
h.EdgeColor = 'k';
However, you have so many edges in this plot that when you turn the edges back on, the entire plot will look black.

카테고리

Help CenterFile Exchange에서 Surface and Mesh Plots에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by