Skip to content

Instantly share code, notes, and snippets.

@jarmitage
Last active August 29, 2015 14:25
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 jarmitage/a5b33dbdd9d7605757f9 to your computer and use it in GitHub Desktop.
Save jarmitage/a5b33dbdd9d7605757f9 to your computer and use it in GitHub Desktop.
R: two y axis plot
plot (V1, V2,
type = "p",
col = "red",
cex = .2,
xlab = "Force (N)",
ylab = "Raw",
ylim = c(0,4096))
grid (col = "lightgray", lty = "dotted", lwd = par("lwd"), equilogs = TRUE)
par (new = TRUE)
plot (V1, V3,
type = "p",
col = "blue",
cex = .2,
xaxt = "n",
yaxt = "n",
xlab = "",
ylab = "")
axis (4)
mtext ("Aftertouch", side = 4, line = 3)
legend ("bottomright", col = c ("red", "blue"), lty = 1, legend = c ("Raw", "Aftertouch"))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment