Dear All, I've done some searching, but to no avail -- I'm plotting x-y data via the "plot" command, and the "log=x" command. The graphed x values are in scientific notation (1e-02 1e-01 1e+00 etc). Might you have some idea on how I can get the plot to uses the x values (0.01 0.10 1.0 10.0 etc) instead? A related Q - where might a good place to search for such answers? I've tried using Google searches and reading some posted Manuals but ... Thanks, Tim O'Brien [[alternative HTML version deleted]]
Hi, There may be a simpler way but try this, plot(10^jitter(seq(-2,4,length=10)), 1:10, log="x", xaxt="n") axis(1, at = axTicks(1),labels = format(axTicks(1),scientific=FALSE)) HTH, baptiste On 18 July 2010 10:58, Timothy O'Brien <teobrien at gmail.com> wrote:> Dear All, > > I've done some searching, but to no avail -- > > I'm plotting x-y data via the "plot" command, and the "log=x" command. > > The graphed x values are in scientific notation (1e-02 1e-01 1e+00 etc). > Might you have some idea on how I can get the plot to uses the x values > (0.01 0.10 1.0 10.0 etc) instead? ?A related Q - where might a good place to > search for such answers? ?I've tried using Google searches and reading some > posted Manuals but ... > > Thanks, > Tim O'Brien > > ? ? ? ?[[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. >
On 07/18/2010 06:58 PM, Timothy O'Brien wrote:> Dear All, > > I've done some searching, but to no avail -- > > I'm plotting x-y data via the "plot" command, and the "log=x" command. > > The graphed x values are in scientific notation (1e-02 1e-01 1e+00 etc). > Might you have some idea on how I can get the plot to uses the x values > (0.01 0.10 1.0 10.0 etc) instead? A related Q - where might a good place to > search for such answers? I've tried using Google searches and reading some > posted Manuals but ... >Hi Tim, The "scipen" option is the one usually recommended for this. R works out how to print a number in a way that is (hopefully) maximally informative and minimally long. By "penalizing" this method, you can suppress scientific notation most of the time: print(100000) [1] 1e+05 options(scipen=4) print(100000) [1] 100000 On the R home page is an option "Search". The first search listed is Jon Baron's searchable archive messages, functions, etc. and is a good place to start. In this case, you would have to take two steps - see the "scipen" option mentioned and then look at the "options" help page. Usually you will get the answer straight from the search, _if_ you choose the correct search terms (life is never simple). Jim
Hi Tim, You might want to try it with the following: par(usr=c(-2,1,ymin,ymax) Where -2 and 1 are the exponents for your x-values, and ymin and ymax the margins you want for your y-values. Then you plot as usual adding the following parameters: plot(x,y,....,log="x",xlim=c(10^par("usr")[1:2]),xaxp=c(0.01,10,1)) Hope this will work for you! It might also help to read through the help-files on "?par()" where all graphical parameters are explained. /Birte