簡體   English   中英

在Matlab中將曲面/線添加到3D干圖

[英]Add surface/line to 3D stem plot in Matlab

說我有一個使用stem3的3D干圖

stem3(xx,yy,zz,'red')

在此處輸入圖片說明

我想添加一條線或半透明表面到550(zz = 550)的高度。 有沒有辦法做到這一點?

您可以僅使用普通的surf對象來執行此操作。

% Create your stem3 object
stem3(rand(10), rand(10), rand(10) * 700, 'r');

hold on

% Get the current X and Y Limits of the axes
xdata = get(gca, 'xlim');
ydata = get(gca, 'ylim');

% Ensure that the axes limimts don't change when we plot the surface
axis manual

% Create a surface that spans the axes and is of height 550 (the third input)
% Use alpha value of 0.1 for the face transparency
surf(xdata, ydata, 550 * ones(2), 'FaceAlpha', 0.1, 'FaceColor', 'red');

在此處輸入圖片說明

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM