Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the default font in R 's plot()?

Tags:

plot

r

fonts

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 :)

like image 321
Coldfusion Avatar asked Jan 22 '16 11:01

Coldfusion


People also ask

What font is used in R graphs?

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.

What is the default font size in R?

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.

What is R markdown default font?

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.

What's the default font in ggplot2?

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.


1 Answers

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. :-)

like image 79
Baytars Avatar answered Oct 21 '22 17:10

Baytars