0

I want to make a figure similar to this

See how the bottom portion is tiny... how do I do that?

I'm ok in ggplots2 so give me your expertise please.

I do not need to plot 2 values on the larger one. Essentially, I know how to generate everything I want from this figure, except how to make a tiny plot under a larger one (sans photoshop)

I have data.frames that contain the transcript information in the figure at the bottom, I'm only interested in one gene. To plot the genes you would do something like this

plot(transcript, type="l", lwd=2)
points(exons, type="l", lwd=3, col="blue")
points(utrExons, type="l", lwd=3)

To plot the large figure it would look like this

plot(genetic.variant, pch=16)

An exhaustive internet search turned into bupkis, how do you make two figures in the same plotting area with one of them being much smaller than the other?

Ben
  • 41,615
  • 18
  • 132
  • 227
IMPERATOR
  • 277
  • 1
  • 3
  • 14
  • If you add the code you've already got to your Q then you might get a bit more interest from potential answerers. Questions with [reproducible examples](http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) generally get people's attention here. – Ben Jul 23 '14 at 00:20

2 Answers2

1

With base graphics you can do something like this

dd<-data.frame(x=1:100, y1=runif(100), y2=cumsum(rnorm(100)))
layout(matrix(1:2, ncol=1), heights=c(3,1))
par(mar=c(0,3,3,2))
plot(y1~x,dd, xaxt="n", xlab="")
par(mar=c(3,3,0,2))
plot(y2~x,dd)

enter image description here

MrFlick
  • 195,160
  • 17
  • 277
  • 295
0

You can use layout

layout(c(1,2),widths=c(5,1),heights=c(5,1),T)
par(mar=c(1,1,1,1)

and just change the heights depending on your preference

JakobW
  • 8
  • 1