MathGroup Archive 2005

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Histogram with more than one dataset

  • To: mathgroup at
  • Subject: [mg61049] Re: Histogram with more than one dataset
  • From: Bill Rowe <readnewsciv at>
  • Date: Sat, 8 Oct 2005 02:49:42 -0400 (EDT)
  • Sender: owner-wri-mathgroup at

On 10/7/05 at 3:38 AM, at (kristoph) wrote:

>Due to result comparison it would be very neat if it is possible to
>have more than one dataset in a histogram. What I me is a way to
>superimpose the 3 Histogram I have and compare them, to see

It is possible to overlap histograms. For example,

a = Table[Random[],{100}];
b = Table[Random[]+.25,{100}];

histA = Histogram[a, DisplayFunction->Identity];
histB = Histogram[b, BarStyle->Blue, DisplayFunction->Identity];



but this obsures the fact data set b doesn't extend to 0. Alternatively,
you could do


to combine the plots. But now the fact data set a doesn't extend past 1 is obscured.

Quite frankly, histograms are not that useful for comparing data sets. You would probably be better served using the functions in Statistics`StatisticsPlots` (here I am assuming you have version 5.x or later of Mathematica).



with the overlapped histograms. The box and whisker plot clearly shows the two data sets have similar variation with a shifted range. This function easily handles n data sets.

Another useful plot for comparing two data sets is QuantilePlot.

For example,


results in a scatter plot that is parallel to the reference line but shifted from it. This indicates the difference in the two data sets is a shifted location.
To reply via email subtract one hundred and four

  • Prev by Date: Re: Globally limiting precision or accuracy
  • Next by Date: Re: FortranForm of Integers and Reals
  • Previous by thread: Re: Histogram with more than one dataset
  • Next by thread: How to plot solutions of equations with Mathematica?