pcolor-plot move along the z-axis

4 次查看(过去 30 天)
I have the following code.
The problem is, the pcolorplot crosses the surf-plot and I would like to have the pcolorplot by z=-20
It does't work with pcolor(X,Y,Z-20)
[X,Y] = meshgrid(-5:.5:5); %Regelmäßiges Gitter für X und Y
Z = Y.*sin(X) - X.*cos(Y); %Def. für die Z
%% Darstellung mit Surf
figure (1)
surf(X,Y,Z)
title('Z = Y.*sin(X) - X.*cos(Y)') %Titel
xlabel('x [-]') %x-Achsen Beschriftung
ylabel('y [-]')%y-Achsen Beschriftung
zlabel('z [-]')%z-Achsen Beschriftung
xlim([-5 5]) %Begrenzung der Achsen
ylim([-5 5])
zlim([-15 10])
colorbar('AxisLocation','out') %Farbbalken mit Seite der Skala
shading interp %Schattierung
lighting phong %Beleuchtung
colormap hot %Farbgruppe
alpha (0.5) %Durchsichtigkeit
camlight left
material shiny
hold on
%% Darstellung mit mesh
mesh(X,Y,Z) %unnötig, wenn man Faceted Shading (Default)
hold on
%% Darstellung mit pcolor
pcolor(X,Y,Z)
shading interp %Schattierung
hold on

采纳的回答

Walter Roberson
Walter Roberson 2020-1-26
编辑:Walter Roberson 2020-1-26
Replace
pcolor(X, Y, Z)
With
surf(X, Y, -20*ones(size(Z)), Z, 'edgecolor', 'none' )

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Lighting, Transparency, and Shading 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by