Sideways Histograms

The above image is featured in one of our Mac App Store screenshots.  It includes sideways histograms of monthly temperature data from three U.S. cities: Greensboro, NC; San Francisco, CA; and Flint, MI.

We were recently asked how to create this graphic. Although DataGraph has a Histogram command, it only creates a single histogram at a time. To create a series of sideways histograms, we are actually using the Box command, often used to create box-and-whisker plots.

First, let me show you what this data looks like using a Plot command for one of the cities.  These are average daily temperatures over 10 years.


Plotting the same data using a Box command, where the Values are set to the ‘temperature’ and the Position is set to ‘month’, results in the following image.

Box Whisker

To create the sideways histograms, go into the detail view of the Box command and modify the Type drop-down menu from ‘Whisker’ to ‘Probability’.  Now you have sideways histograms!

Probability Plots

Note that these are slightly different representations of your data when compared to the Histogram command, as each sideways histogram is scaled to the same height.

To create a graphic with all three cities, we used three Box commands and added a fill to each.  In the Axis settings, we also set the X-tick marks drop-down box to ‘Categories’ and set the Labels to a column with the name of each month.

Sideways Histograms

You can see why Mark Twain said, “The coldest winter I ever spent was a summer in San Francisco”, as this west-coast city does not warm up in the summer, when compared to locations like Flint or Greensboro. Although, I wonder whether or not he ever spent a winter in Flint?

For more details, click here to download a DataGraph file containing the data and graphics:  Sideways-Histograms.dgraph

Leave a Reply

Your email address will not be published. Required fields are marked *