[R] Alignment of image plot overlay

tsippel tsippel at gmail.com
Thu Jan 8 23:22:49 CET 2009


I'm having trouble with alignment of a trend line overlayed onto an image
plot.  The two should be plotted on the same x-axis (time-series).  However,
the trend line begins about an inch into the image plot x-axis and ends
about an inch off of end of the image plot.  Once I have the alignment
sorted, I need to put a secondary y-axis on the image plot which is scaled
for the trend line.  An example plot is attached.  My code follows.

tad.image(ptt.tad, dbins, interp=T, loess.interp=F, ylim=c(300,1),
main="STM07.4", zlim=c(0,1))
axis(4, at=c(1,2,3,4), labels=c(1,2,3,4), tick=T, las=1)
par(new=T)
plot(x=stm$dal, y=stm$model, ann=F, axes=F, type="l", col="black", lwd=2)  

Ideas involving the use of par(usr=c(,,,)) haven't solved the issue, and
attempting to convert the x-axis coordinates using the function grconvertX()
hasn't worked either.  Using the axis function as shown here hasn't helped
either.  

The function above called tad.image() was written by someone else, but it
calls the image() function to make the plot shown.  



http://www.nabble.com/file/p21362251/test.plot.jpeg test.plot.jpeg 
-- 
View this message in context: http://www.nabble.com/Alignment-of-image-plot-overlay-tp21362251p21362251.html
Sent from the R help mailing list archive at Nabble.com.




More information about the R-help mailing list