title: Convert units from npc to native using grid in R
body: <p><strong>The core of my problem:</strong></p>
  
  <p>I'm attempting to convert npc units to native units using the grid package's convertUnit, convertX and convertY functions. (npc=normalized parent coordinates, possibly known as ndc units, normalized device coordinates to some in base graphics R. I'm trying to get to native units, those in which the plot is graphed, so in terms of the xlim and ylim units.) However when I attempt to do this as such:</p>
  
  <pre><code>&gt; xyplot(1:10~1:10)
  &gt; convertX(unit(.9, "npc"), "native")
  [1] 484.2native
  </code></pre>
  
  <p>when I'm expecting a number close to 9 as the native x coordinate. It appears convertX is returning units in device coordinates/pixels instead.</p>
  
  <p><strong>Reasoning:</strong>
  I'm trying to use a base locator type device to return npc coordinates, and from those npc coordinates convert to the native coordinates in which the graph was plotted. While I can use base graphics' locator or grid.locator, I'm trying to extend the functionality of this new, non blocking locator to grid/lattice graphics by converting from npc back to native. convertUnit and convertY don't work either.</p>
  
  <p><strong>Question</strong>
  Is it possible for grid to convert from npc back to the active plotting window's native coordinates? Why is convertX returning pixels rather than native coordinates?</p>
  
  <p>Thanks much in advance.</p>
  
  <p>Edited for tags and sloppy mistake leaving out xyplot before. My apologies, but it holds with xyplot. </p>