posted on 09:11 PM on Tuesday 22 August 2023
Since I use ggplot2 on a regular basis to generate plots which the number of axis elements is often variable. I often need to determine the space taken by the axis labels.
So it appears that the default for ggplot2 is helvetica 9 points for
the axis labels. I generate a PDF plot using theme_bw() and
then open the plot in Affinity Designer to check and it was helvetica 9
points.
Now that I know the font and size, checking the following link gives me the average width of a character in Helvetica as being 0.53772 of its height.
https://www.math.utah.edu/~beebe/fonts/afm-widths.html
Therefore a character in 9 points will take up 9 / 72 of
an inch while the width would be 0.53772 * 9 / 72. So using
this values together with the max number of characters in the axis
labels, I can determine the width and height of the axis labels.
On a side note, a point which is a measurement used for font is
basically 1/72 inches. See:
https://en.wikipedia.org/wiki/Point_(typography)
Knives all sharpened (07:02 AM on Wednesday 23 August 2023)
Green pigeon (09:39 AM on Tuesday 22 August 2023)
Sample vote counts (03:13 PM on Thursday 17 September 2015)
Genome size (02:07 PM on Tuesday 29 July 2014)
Bioinformatics resources (11:48 AM on Saturday 14 June 2008)
RGraph (08:03 AM on Friday 04 April 2014)
Get genome chromosome lengths (07:39 AM on Friday 13 July 2018)