I can not find out what the default font for the plot()
option in R is. I recall somewhere there it was Helvetica but I cannot find any source to confirm this idea. Does anyone know what the default font in the plot()
option is and how do I change the font?
I know there is the family
option but that is very limited in choice of font. I am also aware there is a family
option under pdf()
which defaults to Helvetica but this captures the graphical image so the font of my plot is determined by the font in the plot()
option.
Anyone got any ideas? In particular, I am interested in making all the text (plot labels, axis labels, main title, etc) into the Helvetica font. Thanks in advance :)
When it comes to making figures in R, you can use any font you like, as long as it's Helvetica, Times, or Courier. Using other fonts that are installed on your computer can seem an impossible task, especially if you want to save the output to PDF.
For all of R's graphical devices, the default text size is 12 points but it can be reset by including a pointsize argument to the function that opens the graphical device.
The RMarkdown output is based on LaTeX, and the default LaTeX font is Computer Modern. You will need to download and install the font on your computer.
R and ggplot can create fantastic graphs, but the default Arial/Helvetica font is too boring and standard. You can change the font used in a plot fairly easily three different ways: All of the built-in ggplot themes have a base_family argument for setting the overall font family for the plot.
For changing the font, refer to this link: https://r-coder.com/plot-r/#Font_family
So if you'd like to make "all the text (plot labels, axis labels, main title, etc) into the Helvetica font", set the family
parameter of plot
to Helvetica
. This worked for me. Hope it will be helpful. :-)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With