Re: [R] little subplot in corner

From: Thomas Steiner <>
Date: Mon, 24 Mar 2008 11:01:43 +0100


Although your solution is perfect, I had later a problem with setting the background. Perhaps you know how to get this as well:

front=c(0.5, .97, 0.5, .97)
par(fig=front, new=T)#, bg="skyblue" does not work rec=c(par("usr")[1]+(par("usr")[2]-par("usr")[1])*front[1],

#rect(rec[1],rec[2],rec[3],rec[4],col="yellow") plot(rnorm(4),type="l",col="blue",xlab="",ylab="")

as you can see it would be good to be able to set the background of the subfigure. as the par(bg=) does not work, I tried to plot a rectangle. Just uncomment the send-last line and you will see that the original plot disappears after some strange rectangle is drawn.

If you have any idea again, it would be evry much appreaciated to let me know. Thomas

PS: to see my first attempts, look at mailing list PLEASE do read the posting guide and provide commented, minimal, self-contained, reproducible code. Received on Mon 24 Mar 2008 - 10:06:40 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Mon 24 Mar 2008 - 12:30:24 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.

list of date sections of archive