ILNumerics - Technical Application Development
Assembly: ILNumerics.Toolboxes.Drawing2 (in ILNumerics.Toolboxes.Drawing2.dll) Version: 5.5.0.0 (5.5.7503.3146)
Creates a new Bar plot based on provided values Y.
[ILNumerics Drawing2 Toolbox]
Namespace: ILNumerics.Drawing.Plotting
Assembly: ILNumerics.Toolboxes.Drawing2 (in ILNumerics.Toolboxes.Drawing2.dll) Version: 5.5.0.0 (5.5.7503.3146)
Syntax
public BarPlot( InArray<double> Y, InArray<double> X = null, Object tag = null, BarPlotStyle style = BarPlotStyle.grouped, Nullable<Color> borderColor = null, Nullable<Color> fillColor = null, int lineWidth = 1, DashStyle lineStyle = DashStyle.Solid, float barWidth = 0,8f, float baseValue = 0f, bool draw3DBars = false, bool drawHorizontal = false )
Parameters
- Y
- Type: ILNumericsInArrayDouble
Vector or matrix defines bar values to draw. - X (Optional)
- Type: ILNumericsInArrayDouble
[Optional] Vector or matrix defines positions of bars to draw. If not set, bars positions will be placed(or grouped) on range [1,2,..,n]. - tag (Optional)
- Type: SystemObject
[Optional] Tag identifying the plot in the scene - style (Optional)
- Type: ILNumerics.Drawing.PlottingBarPlotStyle
[Optional] Bar plot style specified by one of the values from BarPlotStyle. Default: grouped - borderColor (Optional)
- Type: SystemNullableColor
[Optional] Color of the bar border, default: Color.Black, if border color is set, then defined border color will be assigned to all bar groups. - fillColor (Optional)
- Type: SystemNullableColor
[Optional] Fill color of the bar, default: auto (sequencing individual colors via NextColors provider), if fill color is set, then defined fill color will be assigned to all bar groups. - lineWidth (Optional)
- Type: SystemInt32
[Optional] Bar border width, default: 1px - lineStyle (Optional)
- Type: ILNumerics.DrawingDashStyle
[Optional] Line style, default: solid - barWidth (Optional)
- Type: SystemSingle
[Optional] Bar width specified as single value from 0 to 1. Default: 0.8f. If barWidth is 1.0f, then the bars within a group touch one another - baseValue (Optional)
- Type: SystemSingle
[Optional] Base value specified as scalar value. Default: 0.0f, see also BaseValue property. - draw3DBars (Optional)
- Type: SystemBoolean
[Optional] Drawing style parameter. If set to true, each bar will be drawn as 3D bar, otherwise, as flat rectangles. Default:false. - drawHorizontal (Optional)
- Type: SystemBoolean
[Optional] Drawing style parameter. If set to true, all bars will be drawn horizontally, otherwise, vertically. Default:false.
Exceptions
Exception | Condition |
---|---|
ArgumentException | If Y is null or Y has more than 2 dimensions. |
ArgumentException | If X is empty or X has more than 2 dimensions. |
ArgumentException | If X has different shape than Y See: http://ilnumerics.net/bar-plots.html for allowed shapes definitions. |
Remarks
If Y is specified as vector, BarPlot draws one group of bars. If Y is specified as matrix [m x n], BarPlot draws m groups of n bars.
The following optional parameters: style, barWidth, baseValue, draw3DBars and drawHorizontal could be changed by using public properties.
If style defined as detached, it takes effect only if draw3DBars is set to true.
[ILNumerics Drawing2 Toolbox]
Examples
Example creates and draws BarPlot
private void ilPanel1_Load(object sender, EventArgs e) { // define a random set of points Array<double> Points = rand(4, 3); // setup the plot cube ... ilPanel1.Scene.Add(new PlotCube(twoDMode: false) { // draw bar plot, 3D detached new BarPlot(Points, barWidth: 0.6f, style: BarPlot.BarPlotStyle.detached, draw3DBars: true); }); }
See Also