[R] changing format of y-axis (barplot)

Benilton Carvalho bcarvalh at jhsph.edu
Tue Feb 26 07:52:23 CET 2008


bp = barplot(df$y,names.arg=NULL, yaxt="n", ylim=c(0, 1100000))
text(bp, df$y+15000, paste("Class", 1:6))
axis(2, df$y)

b

On Feb 26, 2008, at 1:41 AM, milton ruser wrote:

> Dear all,
>
> I have some data.frame and I would like (1) change the format of  
> y=axis to
> escape of scientific format (like 1e+05...) and (2) label the value  
> or other
> variable on the top of the bar.
>
> df<-data.frame(x=1:6,y=c(100,500,1000,25000,500000,1000000))
> barplot(df$y,names.arg=df$x)
>
> Thanks in advance,
>
> miltinho
> Brazil
>
> 	[[alternative HTML version deleted]]
>
> ______________________________________________
> 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