I think this is a bug; at least this behavior is not documented in plot or plot.default. plot.default resets xaxp, and leaves xaxp reset when it exits: par(xaxp=c(0,1,4)) print(par("xaxp")) plot(c(0,1),c(0.2,0.3)) print(par("xaxp")) R. Woodrow Setzer, Jr. Phone: (919) 541-0128 Experimental Toxicology Division Fax: (919) 541-5394 Pharmacokinetics Branch NHEERL MD-74; US EPA; RTP, NC 27711 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Sorry, I forgot to include version information. This is platform i386-pc-mingw32 arch i386 os mingw32 system i386, mingw32 status Patched major 1 minor 5.0 year 2002 month 05 day 15 language R on Windows version: Windows 98 SE 4.10 (build 2222) A R. Woodrow Setzer, Jr. Phone: (919) 541-0128 Experimental Toxicology Division Fax: (919) 541-5394 Pharmacokinetics Branch NHEERL MD-74; US EPA; RTP, NC 27711 ----- Forwarded by Woodrow Setzer/RTP/USEPA/US on 06/04/02 03:23 PM ----- |---------+---------------------------> | | Woodrow Setzer | | | | | | 06/04/02 03:22 | | | PM | | | | |---------+---------------------------> >---------------------------------------------------------------------------------------------------------| | | | To: r-help list | | cc: | | Subject: par(xaxp) | >---------------------------------------------------------------------------------------------------------| I think this is a bug; at least this behavior is not documented in plot or plot.default. plot.default resets xaxp, and leaves xaxp reset when it exits: par(xaxp=c(0,1,4)) print(par("xaxp")) plot(c(0,1),c(0.2,0.3)) print(par("xaxp")) R. Woodrow Setzer, Jr. Phone: (919) 541-0128 Experimental Toxicology Division Fax: (919) 541-5394 Pharmacokinetics Branch NHEERL MD-74; US EPA; RTP, NC 27711 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
On Tue, 4 Jun 2002 Setzer.Woodrow at epamail.epa.gov wrote:> I think this is a bug; at least this behavior is not documented in plot > or plot.default.See the definition of a bug in the FAQ.> plot.default resets xaxp, and leaves xaxp reset when it exits: > > par(xaxp=c(0,1,4)) > print(par("xaxp")) > plot(c(0,1),c(0.2,0.3)) > print(par("xaxp"))xaxp is defined as `xaxp' A vector of the form `c(x1, x2, n)' giving the coordinates of the extreme tick marks and the number of intervals between tick-marks. so it is redefined whenever axes are drawn. Many of the graphics par's are reset when a plot is drawn. par("usr") is another one. I don't see why you expected otherwise (and in particular why you expected this to be documented under plot.default). -- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272860 (secr) Oxford OX1 3TG, UK Fax: +44 1865 272595 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Of course, you are right. What had originally startled me was that I was not able to force plot to accept xaxp=c(0,1,4), even if I include it as an argument to plot: plot(c(0,1),c(0.2,0.3),xaxp=c(0,1,4)). I sent my email before my thoughts were quite in order. Since plot.default includes "..." as an argument, documented as: ... graphical parameters as in par may also be passed as arguments. I assumed I should be able to manually specify xaxp. The fact that plot () leaves xaxp reset is a red herring (perhaps I was seeing plot() as being not only willful but defiant: having a 5-year-old around the house seems to color my reactions to things of late). So, the real issue is the inability to set xaxp for plot() either within or outside of the call to plot using par(). Of course, there is a simple workaround using xaxt="n", and axis() R. Woodrow Setzer, Jr. Phone: (919) 541-0128 Experimental Toxicology Division Fax: (919) 541-5394 Pharmacokinetics Branch NHEERL MD-74; US EPA; RTP, NC 27711 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
I don't understand why this doesn't work: ---- plot(c(0,1),c(0.2,0.3),xaxt="n") axis(1,xaxp=c(0,1,4)) ---- Or why this (more obvious to me) doesn't work: ---- plot(c(0,1),c(0.2,0.3),xaxp=c(1,0,4)) ---- (I still get 5 intervals on the x-axis) This has bothered me for months. I still don't understand why I shouldn't expect only 4 intervals in both of these cases. It wasn't until I saw this exchange that I realized that: ---- plot(c(0,1),c(0.2,0.3),xaxt="n") par(xaxp=c(0,1,4)) axis(1) ---- does work. Perhaps if someone can explain to me why the first two don't work, I'll be better able to anticipate this behavior in other R functions in the future... Should "xaxp" be listed among the options which can't be set in "high-level" and "mid-level" plot functions in the documentation for "par"? Plot and axis don't give error messages, such as the one 'plot' gives if I try to set "ps"... platform i586-pc-linux-gnu arch i586 os linux-gnu system i586, linux-gnu status major 1 minor 5.0 year 2002 month 04 day 29 language R confused, -- Robert Merithew, PhD LASSP, Clark Hall Cornell University Ithaca NY 14850 USA -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._