Re: [R] little subplot in corner

From: Thomas Steiner <finbref.2006_at_gmail.com>
Date: Mon, 24 Mar 2008 11:01:43 +0100

Henrique,

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

set.seed(24032008)
plot(rnorm(10),type="l",col="red")
grid()
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],

par("usr")[3]+(par("usr")[4]-par("usr")[3])*front[3],
par("usr")[1]+(par("usr")[2]-par("usr")[1])*front[3],
par("usr")[1]+(par("usr")[2]-par("usr")[1])*front[4])
#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
http://commons.wikimedia.org/wiki/Image:Eurusd-id.png



R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html 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 https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive