Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- legend(4, 20, c("Placebo", "Progabide"), lty=1:2, pch=c(1,16), col=1:2, cex=0.8)
- plot(x=1:10,y=1:10+rnorm(10), ylim=c(0,11))
- # draw default box and store size of default rect in 'a'
- # disable this default rect by adding plot=F to legend()
- a=legend(x=1,y=9, c("old box", "new box"), lty=1, col=2:1, cex=0.8, y.intersp=0.8,box.col=2)#,plot=F)
- # box size reduced by factor 0.75
- a=a$rect
- mid = a$top - 0.5*a$h
- reduction = 0.75
- # draw new box
- rect(xleft=a$left, ytop=mid+0.5*reduction*a$h, xright=a$left+a$w, ybottom=mid-0.5*reduction*a$h)
- # add legend items to new box
- legend(x=1,y=9, c("old box", "new box"), lty=1, col=2:1, cex=0.8, y.intersp=0.8, bty='n')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement