Date: Nov 6, 2013 12:22 AM
Author: Bob Hanlon
Subject: Re: PlotRange with Histogram Log height

You must take the Log of the vertical axis range values

data = RandomVariate[

TruncatedDistribution[{-2, 2},

NormalDistribution[0, 0.5]], 1000];

Histogram[data, 10, {"Log", "PDF"},

PlotRange -> {{-2, 2}, Automatic},

Frame -> True,

PlotRangeClipping -> True]

Histogram[data, 10, {"Log", "PDF"},

PlotRange -> {{-2, 2}, Log /@ {0.01, 1.0}},

Frame -> True,

PlotRangeClipping -> True]

However, since Log is Listable, this can be shortened slightly to

Attributes[Log]

{Listable, NumericFunction, Protected}

Histogram[data, 10, {"Log", "PDF"},

PlotRange -> {{-2, 2}, Log@{0.01, 1.0}},

Frame -> True,

PlotRangeClipping -> True]

Bob Hanlon

On Mon, Nov 4, 2013 at 11:18 PM, Jeff <jbwjbwjbw@gmail.com> wrote:

> I am trying to draw a histogram with log heights with a specified

> PlotRange. This command works fine:

>

> Histogram[data, 10, {"Log", "PDF"},

> PlotRange -> {{-2, 2}, Automatic}, Frame -> True,

> PlotRangeClipping -> True]

>

> But what I need is the ability to control the range of the vertical axes.

> When I change the "Automatic" to something specific I get a blank graph.

> For example, this fails

>

> Histogram[data, 10, {"Log", "PDF"},

> PlotRange -> {{-2, 2}, {0.01, 1.0}}, Frame -> True,

> PlotRangeClipping -> True]

>

> I am using Mathematica 9.0.1.0 on OSX 10.8.5. Any help would be

> appreciated.

>

>