Re: [R] little subplot in corner

2008-03-24 Thread Thomas Steiner
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@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.


[R] little subplot in corner

2008-03-20 Thread Thomas Steiner
I want to draw a little subplot (overview) into my detailed plot. It
should be placed in say the top right corner and have the size of some
legend (like legend(x=topright, inset=0.03, ...)

#main plot
plot(rnorm(100))
#give little density in corner
plot(seq(-2,2,length=300),dnorm(seq(-2,2,length=300)),type=l)

I don't want something like par(mfrow=c(1,2)) as this gives subplots
of equal size.
I saw that gridBase is very flexible, but could not find a suitable example.

Thanks for help,
Thomas

__
R-help@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.


Re: [R] little subplot in corner

2008-03-20 Thread Henrique Dallazuanna
I don't if is this what you want, but:

plot(rnorm(100))
par(fig=c(0, 1/2, 0, 1/2), new=T)
plot(seq(-2,2,length=300),dnorm(seq(-2,2,length=300)),type=l, axes =
F, xlab=, ylab=)


On 20/03/2008, Thomas Steiner [EMAIL PROTECTED] wrote:
 I want to draw a little subplot (overview) into my detailed plot. It
  should be placed in say the top right corner and have the size of some
  legend (like legend(x=topright, inset=0.03, ...)

  #main plot
  plot(rnorm(100))
  #give little density in corner
  plot(seq(-2,2,length=300),dnorm(seq(-2,2,length=300)),type=l)

  I don't want something like par(mfrow=c(1,2)) as this gives subplots
  of equal size.
  I saw that gridBase is very flexible, but could not find a suitable example.

  Thanks for help,
  Thomas

  __
  R-help@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.



-- 
Henrique Dallazuanna
Curitiba-Paraná-Brasil
25° 25' 40 S 49° 16' 22 O

__
R-help@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.


Re: [R] little subplot in corner

2008-03-20 Thread Thomas Steiner
perfect, exactly what I was looking for. Thanks a lot!
many eggs to you...
Thomas

__
R-help@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.


Re: [R] little subplot in corner

2008-03-20 Thread Greg Snow
Look at the subplot function in the TeachingDemos package (the
cnvrt.coords function in the same package can be used to help in finding
coordinates to place the plot).

Hope this helps,

-- 
Gregory (Greg) L. Snow Ph.D.
Statistical Data Center
Intermountain Healthcare
[EMAIL PROTECTED]
(801) 408-8111
 
 

 -Original Message-
 From: [EMAIL PROTECTED] 
 [mailto:[EMAIL PROTECTED] On Behalf Of Thomas Steiner
 Sent: Thursday, March 20, 2008 9:04 AM
 To: [EMAIL PROTECTED]
 Subject: [R] little subplot in corner
 
 I want to draw a little subplot (overview) into my detailed 
 plot. It should be placed in say the top right corner and 
 have the size of some legend (like legend(x=topright, 
 inset=0.03, ...)
 
 #main plot
 plot(rnorm(100))
 #give little density in corner
 plot(seq(-2,2,length=300),dnorm(seq(-2,2,length=300)),type=l)
 
 I don't want something like par(mfrow=c(1,2)) as this gives 
 subplots of equal size.
 I saw that gridBase is very flexible, but could not find a 
 suitable example.
 
 Thanks for help,
 Thomas
 
 __
 R-help@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.
 

__
R-help@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.