pcolor-plot move along the z-axis

2 ビュー (過去 30 日間)
Franziska Domeier
Franziska Domeier 2020 年 1 月 26 日
コメント済み: Franziska Domeier 2020 年 1 月 29 日
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' )
  1 件のコメント
Franziska Domeier
Franziska Domeier 2020 年 1 月 29 日
Thanks

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLighting, Transparency, and Shading についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by