hck
2011-Apr-29 10:35 UTC
[R] plot several histograms with same y-axes scaling using hist()
Dear all Problem: hist()-function, scale = ?percent? I want to generate histograms for changing underlying data. In order to make them comparable, I want to fix the y-axis (vertical-axis) to, e.g., 0%, 10%, 20%, 30% as well as to fix the spaces, too. So the y-axis in each histogram should be identical. Currently, I have 100 histograms and the y-axis scales changes in each. Here is my code: ="Hist(na.exclude("&AA3&"), breaks=50, col=""seashell3"", scale=""percent"",xlim=c(-1, 1), xlab=""Bewertungsfehler"", ylab=""Haeufigkeit (in %)"", main=""KBV"", border=""white"")" I tried the ylim=c(?), but unfortunately it does not work. Thanks for your help in advance! Regards, Hans -- View this message in context: http://r.789695.n4.nabble.com/plot-several-histograms-with-same-y-axes-scaling-using-hist-tp3483376p3483376.html Sent from the R help mailing list archive at Nabble.com.
Philipp Pagel
2011-Apr-29 11:39 UTC
[R] plot several histograms with same y-axes scaling using hist()
On Fri, Apr 29, 2011 at 03:35:41AM -0700, hck wrote:> Problem: hist()-function, scale = ?percent?[...]> ="Hist(na.exclude("&AA3&"), breaks=50, col=""seashell3"", > scale=""percent"",xlim=c(-1, 1), xlab=""Bewertungsfehler"", > ylab=""Haeufigkeit (in %)"", main=""KBV"", border=""white"")"Before anyone can really help you'll need to let us know where your Hist() function came from. hist() from package graphics does not have a scale parameter and honours ylim without a problem. cu Philipp -- Dr. Philipp Pagel Lehrstuhl f?r Genomorientierte Bioinformatik Technische Universit?t M?nchen Wissenschaftszentrum Weihenstephan Maximus-von-Imhof-Forum 3 85354 Freising, Germany http://webclu.bio.wzw.tum.de/~pagel/
hck
2011-Apr-29 11:48 UTC
[R] plot several histograms with same y-axes scaling using hist()
Thanks for the note: Indeed, the function is the hist() function not Hist() with capital letter. I use the standard R hist()-function with the lower case only. Nevertheless, the ylim does not work as supposed to. -- View this message in context: http://r.789695.n4.nabble.com/plot-several-histograms-with-same-y-axes-scaling-using-hist-tp3483376p3483479.html Sent from the R help mailing list archive at Nabble.com.
Jim Lemon
2011-Apr-29 12:39 UTC
[R] plot several histograms with same y-axes scaling using hist()
On 04/29/2011 08:35 PM, hck wrote:> Dear all > > Problem: hist()-function, scale = ?percent? > > I want to generate histograms for changing underlying data. In order to make > them comparable, I want to fix the y-axis (vertical-axis) to, e.g., 0%, 10%, > 20%, 30% as well as to fix the spaces, too. So the y-axis in each histogram > should be identical. Currently, I have 100 histograms and the y-axis scales > changes in each. > > Here is my code: > > ="Hist(na.exclude("&AA3&"), breaks=50, col=""seashell3"", > scale=""percent"",xlim=c(-1, 1), xlab=""Bewertungsfehler"", > ylab=""Haeufigkeit (in %)"", main=""KBV"", border=""white"")" > > I tried the ylim=c(?), but unfortunately it does not work.Hi Hans, The "barp" function in plotrix can plot histograms (see the last example on the help page) and may be flexible enough to do what you want. Jim
Uwe Ligges
2011-May-01 15:52 UTC
[R] plot several histograms with same y-axes scaling using hist()
On 29.04.2011 14:39, Jim Lemon wrote:> On 04/29/2011 08:35 PM, hck wrote: >> Dear all >> >> Problem: hist()-function, scale = ?percent? >> >> I want to generate histograms for changing underlying data. In order >> to make >> them comparable, I want to fix the y-axis (vertical-axis) to, e.g., >> 0%, 10%, >> 20%, 30% as well as to fix the spaces, too. So the y-axis in each >> histogram >> should be identical. Currently, I have 100 histograms and the y-axis >> scales >> changes in each. >> >> Here is my code: >> >> ="Hist(na.exclude("&AA3&"), breaks=50, col=""seashell3"", >> scale=""percent"",xlim=c(-1, 1), xlab=""Bewertungsfehler"", >> ylab=""Haeufigkeit (in %)"", main=""KBV"", border=""white"")" >> >> I tried the ylim=c(?), but unfortunately it does not work. > > Hi Hans, > The "barp" function in plotrix can plot histograms (see the last example > on the help page) and may be flexible enough to do what you want.#or just use a fixed ylim? Uwe> Jim > > ______________________________________________ > 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.
Maybe Matching Threads
- question about contrast in R for multi-factor linear regression models?
- Accessing all the first sub-elements of a list of list
- Re: [PATCH] v2v: virtio-win: include *.dll too
- 2SLS / TSLS / SEM non-linear
- Storing results in a single file after looping over all files