cls59 wrote:
> 
> 
> # recovering par('xaxp') uses the original x limits.
> plot.window( xlim = range( par('xaxp')[1:2] ), ylim = range( density(x)$y
> )) 
> 
> 

Actually, I misspoke. I believe the following is the voodoo you want for
exactly recovering the original xlimit:


  plot.window( xlim = range( par('usr')[1:2] ), xaxs = 'i', ylim = range(
density(x)$y )) 


Basically, par('xaxp')[1:2] only returns the extreme values of the tick
marks on the original x-axis-- using these can still cause points not to
line up. par('usr')[1:2] returns the coordinates of the left and right edges
of the plot screen. setting xaxs to 'i' causes R to use the xlimit exactly
as given and not to pad it by 4% in an attempt to make it "pretty".

Good luck!

-Charlie

-----
Charlie Sharpsteen
Undergraduate
Environmental Resources Engineering
Humboldt State University
-- 
View this message in context: 
http://www.nabble.com/Second-y-axis-----alternative-to-par%28new%3D-tp25782532p25787984.html
Sent from the R help mailing list archive at Nabble.com.

______________________________________________
R-help@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.

Reply via email to