| Contents | Index |
plot::Bars3d(A) generates a 3D bar chart with bar heights given by the entries of the matrix A.
Calls:
plot::Bars3d(A, <x =
..
, y =
..
>, <a = amin .. amax>, Options)
plot::Bars3d(L, <x =
..
, y =
..
>, <a = amin .. amax>, Options)
Parameters:
|
A: |
an array of domain type DOM_ARRAY or a matrix of category Cat::Matrix (e.g., of type matrix or densematrix) containing real numerical values or expressions of the animation parameter |
|
L: |
a list of lists of real numerical values or expressions of the animation parameter |
|
x: |
name of the horizontal variable: an identifier or an indexed identifier. It is used as the title of the coordinate axis in |
|
|
the range of the horizontal variable: |
|
y: |
name of the vertical variable: an identifier or an indexed identifier. It is used as the title of the coordinate axis in |
|
|
the range of the vertical variable: |
Related Domains:
plot::Bars2d, plot::Histogram2d, plot::Matrixplot
Related Functions:
Details:
The rows of the matrix are plotted along the
coordinate, the columns along the
coordinate.
Different rows may be regarded as different classes of data. Each row has a different color determined by the the attribute Colors = [
,
, ...] with RGB or RGBa colors c1, c2 etc.
The simplest way to obtain a uniform coloring of all rows with the color c is to specify the attribute Color = c.
Arrays/matrices do not need to be indexed from
. E.g.,
A = array(
,
, [..data..])
yields a bar chart with
rows and
columns, stretching from
to
in
direction and from
to
in
direction.
If no plot range
,
is specified,
,
,
,
is used.
When the values are specified by a list of lists
and no plot range
,
is specified,
,
,
,
is used, where
is the length of
and
is the (common) length of the sublists in
. All sublists (“rows”) must have the same length.
The attribute BarStyle allows to switch the style of the bars between Boxes (bars), Lines (vertical lines), LinesPoints (vertical lines and points), and Points(points only). Cf. example 1.
The attribute Gap =
or, equivalently, XGap = gx, YGap = gy allows to introduce gaps between adjacent bars. The values gx, gy may be real numerical values between
and
or expressions of the animation parameter a. These values set the fraction of the space reserved for a bar that is not filled by the bar.
With
,
, there are no gaps. With
,
, the gaps between adjacent bars are of the same size as the bars. With
,
, there bars become lines.
Values of gx, gy larger than
are treated like
, negative values like
.
The attribute Ground = z0 determines the
value of the lower or upper face of the bars. Matrix values
are displayed as bars stretching in
direction from the lower face z0 to the upper face m. Matrix values
are displayed as bars stretching in
direction from the upper face z0 down to the lower face m.
The parameter z0 has to be a numerical real value or an expression of the animation parameter a.
If the attribute Ground = z0 is not specified, the default value
is used.
Example 1
We create some random matrix data and plot them as a bar chart:
A := matrix::random(5, 10, frandom) :
plot(plot::Bars3d(A, Gap = [0.4, 0.7]))

We create bar charts of the data with different BarStyle options:
plot(plot::Scene3d(plot::Bars3d(A, BarStyle = Boxes)),
plot::Scene3d(plot::Bars3d(A, BarStyle = Lines)),
plot::Scene3d(plot::Bars3d(A, BarStyle = Points)),
plot::Scene3d(plot::Bars3d(A, BarStyle = LinesPoints)),
PointSize = 2.0*unit::mm, LineWidth = 0.5*unit::mm
):

delete A:
Example 2
We demonstrate the positioning of bar charts by specifying ranges for the
and the
coordinate. The following two bar charts are plotted in one scene. They are placed side by side via suitable
ranges:
A := matrix::random(5, 5, frandom):
plot(plot::Bars3d(A, x = 0 .. 0.9, y = 0 .. 1,
BarStyle = LinesPoints),
plot::Bars3d(A, x = 1.1 .. 2, y = 0 .. 1,
Gap = [0.3, 0.7])):

delete A:
Example 3
We demonstrate the attributes Ground and Color:
A := matrix::random(5, 10, 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
and
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:

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.
| © 1984-2012- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |