MathGroup Archive 2008

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

Search the Archive

Mathematica 7: Histogram Y-axis range?

  • To: mathgroup at
  • Subject: [mg93862] Mathematica 7: Histogram Y-axis range?
  • From: Gordon Robertson <grobertson at>
  • Date: Thu, 27 Nov 2008 05:31:45 -0500 (EST)

I've corrected and adjusted the text below.


I'm using Mathematica 7 on an Intel Mac with OSX 10.5.5. L3111-1191.

I'm finding unexpected behaviour in Mathemaitca 7's Histogram function, as I try to
generate a histogram that worked routinely in Mathematica 6, many times, over the
past few months. 

I have a list of ~2400 real numbers ('mCtrs') whose values are concentrated
in a range that will be near the centre of the Histogram's X-axis. I
generate a histogram with this:

plusMinus = 200;
hDtoC = Histogram[mCtrs, {-plusMinus, plusMinus, 10}]

Unexpectedly, the Y-axis terminates at ~90, and the pale blue bars at the
centre of the histogram extend above this upper limit, which is not at all
presentable. For such a plot, Mathematica 6 automatically extended the Y-axis to
include the bars fully. Looking at the Help documentation, I do not see a
switch that would let me ask to see 'All' of the histogram's Y-range.

An hour ago, the same code gave a correct histogram for an input list that
was somewhat =less= concentrated near the centre of the histogram. This
makes me wonder whether there's some auto-range-clipping that's causing the
problem. But the test case below makes me doubt this.

If I test the 2400 input values, they are 'numbers', as expected:
tnq = Table[NumberQ[motifCtrs[[i]]], {i, Length[motifCtrs]}];

{{True, 2394}}

If I generate a test case, with highly concentrated central values, I see
the full range of bar heights is displayed, as expected (and as in Mathematica 6):
testCtrs = RandomReal[{-5, 5}, 10000];
testCtrs1 = Flatten[Prepend[testCtrs, {-100, 100}]];

Histogram[testCtrs1, {-plusMinus, plusMinus, 10}]

Gordon Robertson
Gene Regulation Informatics
Canada's Michael Smith Genome Sciences Centre
Vancouver BC Canada

  • Prev by Date: Re: Implementation rest modulo 2 needed
  • Next by Date: RE: Limits and Direction
  • Previous by thread: Re: Solve this differential equation with periodic boundary conditions:
  • Next by thread: Re: Mathematica 7: Histogram Y-axis range?