Skip to content

Instantly share code, notes, and snippets.

@rBatt
Created July 29, 2016 18:15
Show Gist options
  • Save rBatt/006267e3e07651d819a1e15ff6eb134b to your computer and use it in GitHub Desktop.
Save rBatt/006267e3e07651d819a1e15ff6eb134b to your computer and use it in GitHub Desktop.
# dev.new(width=3.5, height=3.5)
png("~/Desktop/test2.png", width=3.5, height=3.5, res=150, units='in')
par(mfrow=c(2,1), mar=c(2.5,2.5,0.25,2.5), ps=8, cex=1, mgp=c(1,0.25,0), tcl=-0.15)
plot(1:10, xlab="x", ylab="y", type='o')
par(new=TRUE)
plot(x=1:10, y=cumsum(rnorm(10)), xlab="", ylab="", type='o', col='red', xaxt="n", yaxt="n")
axis(side=4)
mtext("y2", side=4, line=1)
plot(1:10, cumsum(rlnorm(10)), col='blue', type='o', xlab='x', ylab="y3")
dev.off()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment