Ground
Base value
MuPAD® notebooks will be removed in a future release. Use MATLAB® live scripts instead.
MATLAB live scripts support most MuPAD functionality, though there are some differences. For more information, see Convert MuPAD Notebooks to MATLAB Live Scripts.
Optional | MuPAD® expression |
Objects | Ground Default Values |
---|---|
plot::Bars3d , plot::Sweep | 0 |
In bar charts, the attribute Ground
= g
determines
the vertical coordinate value of one end of the bars. Data values m > g are
displayed as bars stretching in the vertical direction from the lower
end g
up to the upper end m
.
Data values m < g are
displayed as bars stretching in the vertical direction from the upper
end g
down to the lower end m
.
In sweep surfaces of type plot::Sweep
, a parametrized
space curve (x(u), y(u), z(u)) is
projected to the x-y-plane
with constant z = g,
where g is
set by the Ground
attribute.
The parameter g
has to be a numerical real
value or an expression of the animation parameter.
If the attribute Ground
= g
is
not specified, the default value g = 0
is used.
We plot the same data with different Ground
values:
A := matrix::random(5, 5, frandom): plot(plot::Scene3d(plot::Bars3d(A, Ground = 0, Color = RGB::Grey)), plot::Scene3d(plot::Bars3d(A, Ground = 0.5, Color = RGB::Grey)), Layout = Horizontal):
In the next call, the ground level is animated. Note that in animations one must specify ranges for the x and y coordinates. We include a transparent plane visualizing the ground level:
plot(plot::Bars3d(A, x = 0 .. 1, y = 0 .. 1, a = 0 .. PI, Color = RGB::Grey, Gap = [0.5, 0.5], Ground = sin(a)), plot::Surface([x, y, sin(a) + 0.001], x = 0 .. 1, y = 0 .. 1, a = 0 .. PI, Mesh = [2, 2], Color = RGB::Blue.[0.5]) ):
delete A:
We use different Ground
values to project
a space curve to the x-y-plane:
plot(plot::Scene3d(plot::Sweep([u, 1-u, sin(2*PI*u)], u = 0..1, Ground = 1), Header = "Ground = 1"), plot::Scene3d(plot::Sweep([u, 1-u, sin(2*PI*u)], u = 0..1, Ground = 0.5), Header = "Ground = 0.5"), plot::Scene3d(plot::Sweep([u, 1-u, sin(2*PI*u)], u = 0..1, Ground = 0), Header = "Ground = 0"), plot::Scene3d(plot::Sweep([u, 1-u, sin(2*PI*u)], u = 0..1, Ground = -1), Header = "Ground = -1"), plot::Scene3d::BorderWidth = 0.5*unit::mm, Layout = Tabular, Rows = 2)