# Basic usage:
plot(1:10)
smallPlot(plot(5:1) )
smallPlot(plot(5:1), x1=30,y1=60, x2=80,y2=30, bg="yellow", yaxt="n")
# if R warns "figure margins too large", try dragging the plot viewer bigger
# select focus for further add-on's:
points(3, 2, pch="+", cex=2)
smallPlot( plot(5:1), bg="blue", resetfocus=FALSE )
points(3, 2, pch="+", cex=2)
# More par settings:
smallPlot( plot(50:1), bg=6, mai=c(0.2, 0.3, 0.1, 0.1))
# If you find any more that screw things up, please let me know!
smallPlot( plot(5:1), bg=8, ann=FALSE)
smallPlot(plot(10:50)) # with default bg ("transparent"), old plot is kept
smallPlot(plot(10:50))
# complex graphics in code chunks:
plot(1:10)
smallPlot( {plot(5:1, ylab="Blubber"); lines(c(2,4,3));
legend("topright", "BerryRocks!", lwd=3) }, bg="white" )
Run the code above in your browser using DataLab