MathGroup Archive 2005

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

Search the Archive

Re: Same scaling for plots/ charts

  • To: mathgroup at smc.vnet.net
  • Subject: [mg62298] Re: [mg62278] Same scaling for plots/ charts
  • From: Bob Hanlon <hanlonr at cox.net>
  • Date: Sat, 19 Nov 2005 23:18:26 -0500 (EST)
  • Reply-to: hanlonr at cox.net
  • Sender: owner-wri-mathgroup at wolfram.com

Needs["Statistics`"];
Needs["Graphics`"];

data1=RandomArray[NormalDistribution[1, 2],{200}];
data2=RandomArray[NormalDistribution[3, 4],{200}];
xmin=Floor[Min[data1,data2]];
xmax=Ceiling[Max[data1,data2]];

BarChart[
    Sequence@@(
        BinCounts[#,{xmin,xmax,(xmax-xmin)/20}]/
              Length[#]&/@{data1,data2}),
    ImageSize->400];

DisplayTogetherArray[
    {DisplayTogether[
            Histogram[#[[1]],
              HistogramScale->1,
              HistogramRange->{xmin,xmax},
              BarStyle->#[[2]]],
            Plot[
              PDF[
                NormalDistribution[
                  Mean[#[[1]]],
                  StandardDeviationMLE[#[[1]]]],
                x],
              {x,xmin,xmax},
              PlotStyle->{
                  AbsoluteDashing[{10,10}]}]]}&/@
      {{data1,Red},{data2,Blue}},
    ImageSize->400];


Bob Hanlon

> 
> From: "kristoph" <kristophs.post at web.de>
To: mathgroup at smc.vnet.net
> Date: 2005/11/19 Sat AM 05:53:59 EST
> Subject: [mg62298] [mg62278] Same scaling for plots/ charts
> 
> Please let me know if anybody knows a way how I can show bar charts for
> different data with the same scale. When the data is more spread
> Mathematica scales the space between each chart down. This mean a
> comparision between two charts is not possible right away.
> 
> I need a way to compare two charts, therefore the scaling should be the
> same for each chart.
> 
> Thank you very much for answer.
> 
> 


  • Prev by Date: Re: Random Normal deviates within compiled function?
  • Next by Date: Re: Re: Weighted histogram
  • Previous by thread: Re: Same scaling for plots/ charts
  • Next by thread: Recursion