What could I do, so the plot doesn't lose quality, after it is automatically saved?
The following code will be an example of plot and save:
data.barplot <- c(80L, 60L, 80L, 40L, 40L, 0L, 80L)
jpeg("/home/machina/Dropbox/Vitor-IC/graficos/teste.jpeg",width = 2600, height = 2800, quality = 100, pointsize = 70)
barplot(data.barplot, ylab = "Percentage: Days of Holidays", names.arg = c("Sun","Mon", "Tue", "Wed","Thu", "Fry", "Sat"))
title(main="Title Here",outer=T, cex.main = 2.4)
dev.off()
The result was a very bad quality image. Thus, could you help me improve it, so it can barely be pleasurable to see?
The generated image is the one bellow.
Note:
I played with the input variables in jpeg
function such as quality, res, height, width, pointsize
, but didn't get the improvement I was aiming for
The default units is pixel
units=px
meaning you cannot increase the quality by usingres
(for instance) because the number of pixels is constant!Change the units, for instance:
Now, increasing
res
will change the number of pixels and thereby the quality of your image (and the size of the file), tryres=600
.Hope this will be of help.