pcolor-plot move along the z-axis

2 visualizaciones (últimos 30 días)
Franziska Domeier
Franziska Domeier el 26 de En. de 2020
Comentada: Franziska Domeier el 29 de En. de 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

Respuesta aceptada

Walter Roberson
Walter Roberson el 26 de En. de 2020
Editada: Walter Roberson el 26 de En. de 2020
Replace
pcolor(X, Y, Z)
With
surf(X, Y, -20*ones(size(Z)), Z, 'edgecolor', 'none' )

Más respuestas (0)

Categorías

Más información sobre Lighting, Transparency, and Shading en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by