[R] how can I adjust the ranges of my y-axis in barplot?

Sarah Goslee sarah.goslee at gmail.com
Wed Oct 3 20:02:22 CEST 2012


Hi,

It sounds to me like you want to change the location of the tick marks
rather than the axis range (which you've already done). For that see
?axis and its various options for placement and labeling and the yaxt
option under ?par to suppress the default axis labels.

Sarah

On Wed, Oct 3, 2012 at 1:50 PM, Yakamu Yakamu <iam_yakamu at yahoo.com> 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)
>
> 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.
>
> 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
>


-- 
Sarah Goslee
http://www.functionaldiversity.org




More information about the R-help mailing list