Hi Uwe,
thank you very much for this great help,
jsut perfect what I needed to know :)
cheers,
Yakamu

--- On Wed, 10/3/12, Uwe Ligges <ligges@statistik.tu-dortmund.de> wrote:


From: Uwe Ligges <ligges@statistik.tu-dortmund.de>
Subject: Re: [R] how can I adjust the ranges of my y-axis in barplot?
To: "Yakamu Yakamu" <iam_yakamu@yahoo.com>
Cc: "r-help@r-project.org" <r-help@r-project.org>
Date: Wednesday, October 3, 2012, 11:02 AM




On 03.10.2012 19:50, Yakamu Yakamu wrote:
> Hi all,
> I am making 2 barplots with 3 different bars inside with command :
>
> bar.wdHo<-barplot(wdHo.mean, names=c(""), cex.lab=1.0, cex.axis=1, cex.names=1, ylim=c(0,15), xlab="", ylab=expression(paste("Thickness (mm"^{2},")")), density=c(0,27,200), col=c("grey90","black","grey"), beside=TRUE, axis.lty=1)
>
> and the other one :
> bar.wdHo<-barplot(wdHo.mean, names=c(""), cex.lab=1.0, cex.axis=1, cex.names=1, ylim=c(0,5), xlab="", ylab=expression(paste("Thickness (mm"^{2},")")), density=c(0,27,200), col=c("grey90","black","grey"), beside=TRUE, axis.lty=1)
>


Not reproducible for us ...

> My question is :
>
> how can i adjust the y range from 0,5,10 and 15? for the first barplot and the second to be 0, 2.5 and 5 ?
> because, even though i put the lim=c(0,15) for the first one, but then it came out as 0,2,4,and so on (with even numbers) and the max is only 14.

You set the range of the whole axis by ylim, if you want to control the 
tick marks, use:

ylim=c(0,15), yaxp=c(0, 15, 3)

and

ylim=c(0,5), yaxp=c(0, 5, 2)

respectively. See ?par for details.


Otherwise, omit the y axis via yaxt="n" and add it separately by a call 
to axis().

Uwe Ligges




>
> because also I would like to show "comparisons" of magnitudes with the other baplots /data that I have, one with max 15 and the other with maximum 5)
>
> Any help/comments/suggestions are highly appreciated,
> THanks in advance,
> cheers,
> Yakamu
>     [[alternative HTML version deleted]]
>
>
>
> ______________________________________________
> R-help@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.
>

	[[alternative HTML version deleted]]


