[R] convert plot to device coords

Barry Rowlingson B.Rowlingson at lancaster.ac.uk
Thu May 8 12:32:38 CEST 2003


Is there a function to convert from plot coordinates to device coordinates?

  It should be easy enough to work out from various par() parameters - 
namely usr, plt, and fig. 'usr' tells us where an (x,y) point is in the 
plot, then 'plt' tells us where it is in the figure, then 'fig' tells us 
where it is in the ((0,1),(0,1)) device space. Then there's the slight 
complication of log axes in the plot space, which makes me wonder if 
this exists somewhere in R already, rather than me writing a buggy version.

  I dont expect a version for lattice graphics, just base graphics!

Barry Rowlingson
Maths and Stats
Lancaster University
Lancaster, UK




More information about the R-help mailing list