Created
March 9, 2020 00:44
-
-
Save SwampThingPaul/981c5ad78bb6297b167034c73a0bd9e4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## quick bar and line plot in base | |
data=data.frame(value=c(3,4,6,2),value2=c(10,12,20,9)) | |
par(oma=c(3,2,0.5,3),mar=c(2,3,0.25,2)) | |
barplot(data$value,ylim=c(0,12),las=2,space=c(0.5)) | |
mtext(side=2,line=2,"Value") | |
par(new=T);x=barplot(data$value2,ylim=c(0,25),axes=F,col=NA,border=NA,space=c(0.5)) | |
lines(x,data$value2,lwd=3) | |
axis(4,las=2) | |
mtext(side=4,line=2.5,"Value 2") | |
axis(1,x,1:4) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment