Re: BarChart Bug?
- To: mathgroup at smc.vnet.net
- Subject: [mg23606] Re: BarChart Bug?
- From: "Allan Hayes" <hay at haystack.demon.co.uk>
- Date: Wed, 24 May 2000 02:16:06 -0400 (EDT)
- References: <8g9nhd$mle@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
Bjorn, If we do not specify the value of the option PlotRange then Mathematica calculates it to include what it considers significant. As you found, the automatic calculation is not always what we need. In your example the small values in the list "probs" cause the cut off at .35. I find that if replace probs with probs/2 then the cut off is at 0.25625. Instead of using PlotRange->{0,1} you might like to try PlotRange ->All. Allan --------------------- Allan Hayes Mathematica Training and Consulting Leicester UK www.haystack.demon.co.uk hay at haystack.demon.co.uk Voice: +44 (0)116 271 4198 Fax: +44 (0)870 164 0565 "Bjorn Leonardz" <cBLZ at hhs.se> wrote in message news:8g9nhd$mle at smc.vnet.net... > Hallo MathGroup, > > I want to display probabilities and cumulative probabilities for a discrete > random variable (integer valued) in the same bar chart. > > In 'My example' (see below), the height of the vertical axis gets chopped > at .35, so the cumprobs do not get properly graphed. When I make two > separate charts they are both OK. > > At the same time the 'Simple test example' works well. > > New trial, this time with the option PlotRange->{0,1} added. > Now it works. > > What went wrong? The Help Browser says nothing about this in the BarChart > article. Why doesn't BarChart[] calculate the PlotRange properly in 'My > example'? > > Regards, > Bjorn Leonardz > > ----------------------------------------------- > > << Graphics`Graphics` > > ** Simple test example > testprobs = {.1, .2, .4, .2, .1}; > testcumprobs = {.1, .3, .7, .9, 1.}; > BarChart[testprobs, testcumprobs] > > ** My example > probs = {1, 3, 6, 9, 11, 13, 14, 13, 11, 9, 6, 3, 1}/100. > cumprobs = {1, 4, 10, 19, 30, 43, 57, 70, 81, 90, 96, 99, 100}/100. > BarChart[probs] > BarChart[cumprobs] > BarChart[probs, cumprobs] > BarChart[probs, cumprobs, PlotRange->{0,1}] > > >