0

假设我有一个使用 stem3 的 3D 茎图

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

在此处输入图像描述

我想将一条线或半透明曲面添加到 550 (zz = 550) 的高度。有没有办法做到这一点?

4

1 回答 1

1

你可以用一个普通的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');

在此处输入图像描述

于 2016-06-03T19:32:27.063 回答