[R] log y 'axis' of histogram

Derek M Jones derek at knosof.co.uk
Mon Aug 30 17:37:17 CEST 2010


Hadley,

>> I have counts ranging over 4-6 orders of magnitude with peaks
>> occurring at various 'magic' values.  Using a log scale for the
>> y-axis enables the smaller peaks, which would otherwise
>> be almost invisible bumps along the x-axis, to be seen
>
> That doesn't justify the use of a _histogram_  - and regardless of

The usage highlights meaningful characteristics of the data.
What better justification for any method of analysis and display is
there?

> what distributional display you use, logging the counts imposes some
> pretty heavy restrictions on the shape of the distribution (e.g. that
> it must not drop to zero).

Does there have to be a recognized statistical distribution to use R?
In my case I am using R for all of the analysis and graphics in a
new book.  This means that sometimes I have to deal with data sets
that are more or less a jumble of numbers with patterns in a few
places.  For instance, the numeric value of integer constants
appearing as one operand of the binary bitwise-AND operator (see
figure 1224.1 of www.knosof.co.uk/cbook/usefigtab.pdf, raw data
at: www.knosof.co.uk/cbook/bandcons.hist.gz)

qplot(band, binwidth=8, geom="histogram") + scale_y_log()
does a good job of highlighting the peaks.

> It may be useful for your purposes, but that doesn't necessarily make
> it a meaningful graphic.

Doesn't being useful for my purpose make it meaningful, at least for me
and I hope my readers?

-- 
Derek M. Jones                         tel: +44 (0) 1252 520 667
Knowledge Software Ltd                 mailto:derek at knosof.co.uk
Source code analysis                   http://www.knosof.co.uk



More information about the R-help mailing list