       Re: Histogram with more than one dataset

• To: mathgroup at smc.vnet.net
• Subject: [mg61049] Re: Histogram with more than one dataset
• Date: Sat, 8 Oct 2005 02:49:42 -0400 (EDT)
• Sender: owner-wri-mathgroup at wolfram.com

```On 10/7/05 at 3:38 AM, kristophs.post at web.de (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
>differences.

It is possible to overlap histograms. For example,

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

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

then

Show[a,b];

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

Show[b,a];

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).

Contrast

<<Statistics`
BoxWhiskerPlot[data1,data2];

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,

QuantilePlot[data1,data2];

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?