Skip to content

Instantly share code, notes, and snippets.

@csgillespie
Created June 14, 2016 09:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save csgillespie/43116e4ff3a560829a683705d940fa89 to your computer and use it in GitHub Desktop.
Save csgillespie/43116e4ff3a560829a683705d940fa89 to your computer and use it in GitHub Desktop.
f = function(title="") {
set.seed(1)
par(mar=c(3,3,2,1), mgp=c(2,0.4,0), tck=-.01,
cex.axis=0.9, las=1)
plot(rnorm(100), rnorm(100), pch=21, bg="steelblue",
main=paste(title, "device"),
xlab="x-axis label", ylab="y-axis label",
xlim=c(-3,3), ylim=c(-3,3))
text(0,3,
"Le français, c'est façile: Règles, Liberté, Egalité, Fraternité...",
cex=0.8)
text(-2,-3, "italic text", font=3, cex=0.9)
text(2,-3, "Bold text", font=2, cex=0.9)
grid()
}
png("fig1.png", type="cairo")
f("cairo")
dev.off()
png("fig2.png", type="cairo-png")
f("cairo-png")
dev.off()
png("fig3.png", type="quartz")
f("quartz")
dev.off()
png("fig4.png")
f("default")
dev.off()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment