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

9 次查看(过去 30 天)
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