Hi, I'm drawing a very simple plot with both axes logarithmic (default base 10). Example: vec=c(1,10,100,1000,10000,100000,1000000,10000000) plot(vec,vec,log="xy") The axes on the plot now show the technical notation like 1E+3 but I would prefer to have it the notation 10 ^3 i.e. with the exponent here 3 superscript (raised). Any help very much appreciated! Best Regards Tom -- "Feel free" ? 10 GB Mailbox, 100 FreeSMS/Monat ...
On 7/10/2006 12:43 PM, hulubu at gmx.de wrote:> Hi, > > I'm drawing a very simple plot with both axes logarithmic (default base 10). > Example: > vec=c(1,10,100,1000,10000,100000,1000000,10000000) > plot(vec,vec,log="xy") > > The axes on the plot now show the technical notation like 1E+3 but I would prefer to have it the notation 10 ^3 i.e. with the exponent here 3 superscript (raised). > Any help very much appreciated!You can use the plotmath functions for axis labels. For example, > vec=c(1,10,100,1000,10000,100000,1000000,10000000) > plot(vec,vec,log="xy", axes=F) > axis(1, at=10^c(0,2,4,6), labels=expression(1, 10^2, 10^4, 10^6)) > axis(2, at=10^c(0,2,4,6), labels=expression(1, 10^2, 10^4, 10^6)) > box() Duncan Murdoch
You can always draw the axes by hand. ?par with axes =FALSE ?axis ?plotmath for mathematical notation in R (for exponents) -- Bert Gunter Genentech Non-Clinical Statistics South San Francisco, CA "The business of the statistician is to catalyze the scientific learning process." - George E. P. Box> -----Original Message----- > From: r-help-bounces at stat.math.ethz.ch > [mailto:r-help-bounces at stat.math.ethz.ch] On Behalf Of hulubu at gmx.de > Sent: Monday, July 10, 2006 9:43 AM > To: r-help at stat.math.ethz.ch > Subject: [R] 10^x instead 10EX on plot axes. How? > > Hi, > > I'm drawing a very simple plot with both axes logarithmic > (default base 10). > Example: > vec=c(1,10,100,1000,10000,100000,1000000,10000000) > plot(vec,vec,log="xy") > > The axes on the plot now show the technical notation like > 1E+3 but I would prefer to have it the notation 10 ^3 i.e. > with the exponent here 3 superscript (raised). > Any help very much appreciated! > > Best Regards > Tom > -- > > > "Feel free" - 10 GB Mailbox, 100 FreeSMS/Monat ... > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide! > http://www.R-project.org/posting-guide.html >
hulubu at gmx.de wrote:> Hi, > > I'm drawing a very simple plot with both axes logarithmic (default base 10). > Example: > vec=c(1,10,100,1000,10000,100000,1000000,10000000) > plot(vec,vec,log="xy") > > The axes on the plot now show the technical notation like 1E+3 but I would prefer to have it the notation 10 ^3 i.e. with the exponent here 3 superscript (raised). > Any help very much appreciated! >Hi Tom, Have a look at axis.mult in the plotrix package. Jim