Re: [Rd] [FORGED] Different results based on the order of arguments to par

2016-03-15 Thread Greg Snow
Paul, I am fine with not changing the par function, mainly mentioned it as a possibility in case someone else saw additional pitfalls, but nobody else has chimed in. What are your thoughts on adding an additional note to the help for par? it could make it more clear to call things like par(plt=

Re: [Rd] [FORGED] Different results based on the order of arguments to par

2016-03-15 Thread Paul Murrell
Hi The main issue here is that the 'graphics' package has no real concept of going back to a previous plot (the 'grid' package has explicit support for that sort of thing). In 'graphics' you can only go forwards to the next plot; you can fake going back by creating a new plot that is like a

Re: [Rd] [FORGED] Different results based on the order of arguments to par

2016-03-15 Thread Greg Snow
Paul, I was trying to make a minimal self contained example, but I guess I went too far on the minimizing. The original problem came from code more like: library(TeachingDemos) hist(rexp(1000), main='') abline( v=1, col='red') sp.par <- subplot(hist(rnorm(100), main=''), x='topright') op <- p

Re: [Rd] [FORGED] Different results based on the order of arguments to par

2016-03-14 Thread Paul Murrell
Hi I'm going to try to blame user error here. par(usr) is used to reset the coordinates on the CURRENT plot. par(plt) is used to specify the location of the NEXT plot. The correct approach should be to set up the location for the next plot, start a new plot, set up coordinates on the new plot