A Histogram portrays the distributions of one or more variables. They are useful when analyzing continuous variables that can be divided into intervals (bins).
Technical details
Data/Inputs
A table or variable(s).
The following is an explanation of the options available in the Object Inspector for this specific visualization. Refer to Visualization Options for general chart formatting options.
Chart
APPEARANCE
Color The color of the histogram.
Plot vertically Rotates the histogram by 90 degrees.
Cumulative histogram Shows the cumulative density.
Show counts Shows the frequency by category (by default, the proportion is shown instead). To represent this as a percentage when the user hovers, set Object Inspector > Chart > HOVER > Number type to Percentage.
Automatic column widths (bins). A histogram is a column (bar) chart where the width of the columns is arbitrarily determined. By default, an algorithm is used to determine the width of the columns (bars), which are referred as 'bins'.
Maximum column (bins) When Automatic column widths (bins) is unchecked, you can specify the maximum number of bins. This is applied separately where multiple histograms are created (i.e., if one histogram is for data with a smaller range, then the bin widths will be smaller). The number of bins is the smaller of the number specified and the maximum number that are possible given the data. More control can be obtained by manually merging categories in the data and using a column or bar chart.
Output
The example below uses data from a fast-food tracking study. The plot shows the distribution of fast food consumed for different age groups.
Acknowledgements
The histogram is computed using the base R histogram function, and the plot is created using plotly.
Method
- In Displayr: How to Create a Histogram
- In Q: How to Create a Histogram