pcolor-plot move along the z-axis

2 Ansichten (letzte 30 Tage)
Franziska Domeier
Franziska Domeier am 26 Jan. 2020
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

Akzeptierte Antwort

Walter Roberson
Walter Roberson am 26 Jan. 2020
Bearbeitet: Walter Roberson am 26 Jan. 2020
Replace
pcolor(X, Y, Z)
With
surf(X, Y, -20*ones(size(Z)), Z, 'edgecolor', 'none' )

Weitere Antworten (0)

Kategorien

Mehr zu Lighting, Transparency, and Shading finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by