Bars can be used to visualize histograms of data or other
discrete distributions as bar plots.
Each bar starts at the
baseValue (which is often zero)
and reaches up to a certain
value. To position the bar on
an axis, you can specify it's center position with
value along with an optional
In the following code snippets, we will assume that there is an
x and an ordinate named
edge(i.e. the bin limits):
Several examples can be found at Example: Bar plots.
Adaptive histogram mode
Instead of the above data configuration, you can also supply an array
of numbers to the
Bars data object and Kontrast will compute an
adaptive histogram of the data based on the current axis limits and
The following code creates an adaptive histogram of the distribution
of numbers within the array
This shows how the adaptive histogram works. The 20 values are randomly generated and are shown as red points. (The vertical positions of the points have no meaning; they are just used to avoid overlapping the points.)
If you zoom or shift the vertical axis (using Ctrl + Scroll, for example), you'll see that the visible bin-width (i.e., the bin size on the screen) and the positions of the bars are unchanged and the height of the bars are dynamically changed.
Several examples can be found at Example: Adaptive bar histograms.
Please also refer to the documentation for all plot objects.
The abscissa value used whenever no data is assigned to an abscissa.
The ordinate value used whenever no data is assigned to an ordinate.
The applicate value used whenever no data is assigned to an applicate.
The color used whenever no data is assigned to a color axis.
The opacity used whenever no data is assigned to an opacity axis.
The color of border lines. The purpose of the border line is to clearly show the boundary between two neighboring bars, even if they are drawn with the same color and opacity. For example, this facilitates to visually inspect the resolution of the data. To ensure that the border line does not interfere with the color and opacity coding of the data, the border line is only shown if the screen projection of the bar is sufficiently large.
The opacity of border lines. Use a value of
0to hide border lines.
The thickness used whenever no data is assigned to a thickness axis.
This property is only used when the plot is in the
adaptive histogram mode. The value specifies the width (in screen pixels) of the histogram bins. This value is intended to be increased if one desires thicker/wider/larger bins in the adaptive histogram.