简体   繁体   中英

Add surface/line to 3D stem plot in Matlab

Say I have a 3D stem plot using stem3

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

在此处输入图片说明

I want to add a line or a semitransparent surface to a height of 550 (zz = 550). is there a way to do this?

You can do this with just a normal surf object.

% 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');

在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM