R - Histogram Function
Plot & Save Histogram As .png
- Histogram of X vs frequency
plot_1 <- function(){
hist(data$col-name,
main = "title",
xlab = "X",
ylab = "Y",
ylim = c(0, 100), # Changed x & y limits to read values
xlim = c(0, 100),
col = "red")
# Default for this graphic is width = 480, height = 480.
# To change the size add the parameters width & height.
}
plot_1()
png(file = "plot_1.png")
plot_1()
dev.off()
Feedback
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.