[R] Using an image background with graphics

Waichler, Scott R Scott.Waichler at pnl.gov
Tue Oct 21 07:12:27 CEST 2008


Greg,

> The rimage package has functions for reading in and plotting 
> jpeg files that you could use for displaying the photograph.  
> If you then can find 2 points in the image (not on the same 
> horizontal or vertical line) for which you know the 
> coordinates in the coordinate system that you want to plot 
> in, then you can use the updateusr function from the 
> TeachingDemos package to set the user coordinates, then use 
> points/lines or other functions that can add to the current 
> plot (e.g. contour with add=TRUE) to overlay the information 
> of interest to the plot.

I tried this, and your approach works great except for one thing.  I
would like to plot to a pdf device, and when I do so my grayscale image
takes on a gridded appearance, with thick horizontal and vertical lines
of lighter gray.  These don't appear of course if I use jpeg() instead
of pdf().  How can I get rid of those?

Thanks,
Scott Waichler
scott.waichler at pnl.gov



More information about the R-help mailing list