繁体   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