[R] convert plot to device coords

Barry Rowlingson
Thu, 08 May 2003 10:32:38 -0000

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