In R I always find it annoying that base R, lattice and ggplot2 plots all work with absolute point sizes for the size of text and plot symbols.
This means that if you increase say the size of your plot window to get a page-filling graph from
windows(width=5,height=5);qplot(Sepal.Length, Petal.Length, data = iris, color = Species, size = Petal.Width, alpha = I(0.7))
to
windows(width=10,height=10);qplot(Sepal.Length, Petal.Length, data = iris, color = Species, size = Petal.Width, alpha = I(0.7))
that the relative scaling of the text and plot symbols change relative the rest. The same applies to base R and lattice plots.
In the context of some graph export functions I am writing I was wondering if it would be possible to write a function that would take the output of the current graphics device (which can be accessed using recordPlot()
), and scale all plot symbols and text as well as line widths by an arbitrary %, thereby allowing the graph to be exported at any size, whilst still maintaining the same look? I.e. a function to proportionally scale the whole graph to a larger or smaller size while keeping the look the same?
PS the same would be required to be able to scale the RStudio plot window on high DPI 4K screens and still make it legible (right now RStudio uses pixel doubling but this makes the plot window look really fuzzy, and also causes problems in combination with Cleartype on Windows, causing colour fringing).