Skip to content

Instantly share code, notes, and snippets.

@mahito-sugiyama
Last active November 28, 2019 13:37
Show Gist options
  • Save mahito-sugiyama/693cc9d2fd21a86387928d0bcff14307 to your computer and use it in GitHub Desktop.
Save mahito-sugiyama/693cc9d2fd21a86387928d0bcff14307 to your computer and use it in GitHub Desktop.
Customized plot in R
plot2 <- function(..., col_index, draw.axis = TRUE) {
col_list <- c("#e33518", "#0068a2", "#2b6632", "#9f4a00", "#00a5cb", "#43a347")
plot(..., pch = 21, col = col_list[col_index], bg = "white", cex = 2.0, axes = FALSE, xlab = "", ylab = "")
if (draw.axis) axis(1, lwd = 0, lwd.ticks = 1, las = 1, cex.axis = 1.4)
if (draw.axis) axis(2, lwd = 0, lwd.ticks = 1, las = 1, cex.axis = 1.4)
if (draw.axis) box(bty = "l")
}
## pdf("file_name.pdf", width = 8, height = 8, useDingbats = FALSE)
## plot2(x)
## dev.off()
## info: http://www.statmethods.net/advgraphs/parameters.html
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment