Just a side-note. Sometimes this "margin" error occurs because you want to save a high-resolution figure (eg. **dpi = 300** or **res = 300)** in R.
In this case, what you need to do is to specify the width and height. (Btw, **ggsave()** doesn't require this.)
This causes the margin error:
***# eg. for tiff()
par(mar=c(1,1,1,1))
tiff(filename = "qq.tiff",
res = 300, # the margin error.
compression = c( "lzw") )
# qq plot for genome wide association study (just an example)
qqman::qq(df$rawp, main = "Q-Q plot of GWAS p-values", cex = .3)
dev.off()***
This will fix the margin error:
***# eg. for tiff()
par(mar=c(1,1,1,1))
tiff(filename = "qq.tiff",
res = 300, # the margin error.
width = 5, height = 4, units = 'in', # fixed
compression = c( "lzw") )
# qq plot for genome wide association study (just an example)
qqman::qq(df$rawp, main = "Q-Q plot of GWAS p-values", cex = .3)
dev.off()***