How Can I Change the Font for R Plots on Linux

I saw this article on how to change the font of R plots: Change Font of Plot in R - GeeksforGeeks. But the issue is that it recommends the windowsFont() function. As the name implies, that function only works for Windows, I use Linux. Is there another way I can change the font for plots?

I know that for PDF output in R Markdown, I can set the chunk option dev = "tikz". But what about just a plain R script?

Are you using base graphics or a ggplot approach?

Have a look at [Using different fonts with ggplot2 | Statistical Odds & Ends] for a simple ggplot example

I am using base graphics. I guess I will switch to ggplot2, thanks.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.