Mathematica 9 is now available
Student Support Forum
Student Support Forum: 'Histogram PlotRange vs. BarChart BarLabels' topicStudent Support Forum > General > Archives > "Histogram PlotRange vs. BarChart BarLabels"

Help | Reply To Topic
Author Comment/Response
08/25/07 06:57am

I am having a little problem making some histograms. Let's say I have two lists of equal length: one is a list of random numbers between 0 and 1, and the other is a list of the same value. I want to bin these two sets of data and compare their histograms.

The built in function Histogram works nicely for the first example, but for the second it makes one big bar what fills the while x-range, looking dumb. Histogram claims to have PlotRange capabilities but when I try PlotRange->{{0,1},Automatic} it does nothing.

Second option is to compute the histograms manually, and use BarChart to draw them. This produces two nice bar charts which span the same x-range, but the built in BarLabels puts the labels at the center of the bars, rather than the edges (as Histogram does, which is what I'm after).

How do I fix this? The attached notebook contains examples of all this in case my written description didn't make sense.

Attachment: weird_histograms.nb, URL: ,
Help | Reply To Topic