Skip to content

Instantly share code, notes, and snippets.

@DrK-Lo
Created February 7, 2020 15:29
Show Gist options
  • Save DrK-Lo/2ce9685dc3aacc48f620753c2f07f844 to your computer and use it in GitHub Desktop.
Save DrK-Lo/2ce9685dc3aacc48f620753c2f07f844 to your computer and use it in GitHub Desktop.
par(xpd=NA, oma=c(4,0,0,0), mar=c(2,4,0,0),mfrow=c(1,1))
plot(1,1, xlim=c(-1,1), ylim=c(0,1))
# This is for a plot with x-axis from -1 to 1 and y axis from 0 to 1. It plots a legend in the bottom margin
legend(-1,-0.25, legend=c("high sal.", "low sal."), bty="n", adj=0, fill=c("grey", NA), horiz=TRUE)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment