[R] hist - modify maximum frequency (vertical axis)

Daniel Malter daniel at umd.edu
Fri Mar 21 04:46:11 CET 2008


Hi,

type ?hist in the R prompt and look for the ylim argument.

Example:

x=rep(1:10,1:10)
hist(x,ylim=c(0,20))

Manipulate the ylim values as needed.

Cheers,
Daniel


-------------------------
cuncta stricte discussurus
-------------------------

-----Ursprüngliche Nachricht-----
Von: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org] Im
Auftrag von Omar Baqueiro
Gesendet: Thursday, March 20, 2008 11:18 PM
An: r-help at r-project.org
Betreff: [R] hist - modify maximum frequency (vertical axis)

Hello,

Is there a way to easily specify the maximum value to draw a histogram with
the "hist" function? I have 6 histograms, but each of them is drawn with a
different "frequency" range (scaling them to the best visible way), however
I need all the histograms to be scaled so that the maximum frequency is a
specific number (say 300, is the maximum value of the vertical axis). This
value is the maximum value shown overall in all the histograms.

Is that possible?

Thanks,

Omar

--
Omar Baqueiro Espinosa
Computer Science PhD Candidate
Computer Systems Engineer
Workpage: www.csc.liv.ac.uk/~omar/
HomePage (spanish):http://www.baqueiro.co.uk/
PGP Key available at: www.csc.liv.ac.uk/~omar/pgp.html _____

______________________________________________
R-help at r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.



More information about the R-help mailing list