[R] Plot label axis with expression

mariojose mariognu-eco at yahoo.com.br
Wed Aug 22 22:48:26 CEST 2012


Hi all,

I need help with axis in plot.

I want to edit y axis label of my plot. My data is like:

x <- c(100,50,10,1,0.1,0.05,0.001)

plot(log(x))

axTicks(2) # Label of y axis
[1] -6 -4 -2  0  2  4

I'd like that y axis label was like: e^-6, e^-4, etc. (with text "e"
superscript -6, -4, etc.) I try to use expression(), but don't work.

plot(log(x), yaxt="n")
axis(2, at=axTicks(2), labels=expression(rep("e",times=length(axTicks(2))) ^
axTicks(2)), las=2)

Anybody have idea how to do this?

Regards,

MJ
...................................................
Mario José Marques
Master student in Ecology
Institute of Biology, Dept. Plant Biology, Ecology Lab.
State University of Campinas - UNICAMP
Campinas, São Paulo, Brazil 



--
View this message in context: http://r.789695.n4.nabble.com/Plot-label-axis-with-expression-tp4641046.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list