Table of Contents
Font size in base R plots can be changed by utilizing the “cex” argument in the plot function. The “cex” argument allows for the adjustment of the overall size of text, symbols, and lines in a plot. By specifying a value for “cex”, the font size can be increased or decreased accordingly. Additionally, the “cex.axis” and “cex.lab” arguments can be used to specifically change the font size of axis labels and plot labels, respectively. These options provide a simple and efficient way to customize the font size in base R plots.
The Complete Guide: Change Font Size in Base R Plots
You can use the following syntax to change the font size of various elements in base R plots:
plot(df$x, df$y, main='Title', sub='Subtitle', cex.main=2, #change font size of title cex.sub=2, #change font size of subtitle cex.lab=2, #change font size of axis labels cex.axis=2) #change font size of axis text
The following examples show how to use this syntax with the following scatterplot in base R:
#create data frame df <- data.frame(x=c(1, 2, 3, 4, 5, 6), y=c(5, 8, 12, 16, 25, 33)) #create scatterplot with all default font sizes plot(df$x, df$y, main='Title', sub='Subtitle')

Example 1: Change Font Size of Title
The following code shows how to change the font size of the title of the plot:
#create scatterplot with increased font size of title plot(df$x, df$y, main='Title', sub='Subtitle'. cex.main=2)

Example 2: Change Font Size of Subtitle
The following code shows how to change the font size of the subtitle of the plot:
#create scatterplot with increased font size of subtitle plot(df$x, df$y, main='Title', sub='Subtitle'. cex.sub=2)

Example 3: Change Font Size of Axis Labels
The following code shows how to change the font size of the axis labels of the plot:
#create scatterplot with increased font size of axis labels plot(df$x, df$y, main='Title', sub='Subtitle'. cex.lab=2)

Example 4: Change Font Size of Axis Text
The following code shows how to change the font size of the axis text of the plot:
#create scatterplot with increased font size of axis text plot(df$x, df$y, main='Title', sub='Subtitle'. cex.axis=2)

The following tutorials explain how to perform other common plotting operations in R:
Cite this article
stats writer (2024). How can font size be changed in base R plots?. PSYCHOLOGICAL SCALES. Retrieved from https://scales.arabpsychology.com/stats/how-can-font-size-be-changed-in-base-r-plots/
stats writer. "How can font size be changed in base R plots?." PSYCHOLOGICAL SCALES, 15 May. 2024, https://scales.arabpsychology.com/stats/how-can-font-size-be-changed-in-base-r-plots/.
stats writer. "How can font size be changed in base R plots?." PSYCHOLOGICAL SCALES, 2024. https://scales.arabpsychology.com/stats/how-can-font-size-be-changed-in-base-r-plots/.
stats writer (2024) 'How can font size be changed in base R plots?', PSYCHOLOGICAL SCALES. Available at: https://scales.arabpsychology.com/stats/how-can-font-size-be-changed-in-base-r-plots/.
[1] stats writer, "How can font size be changed in base R plots?," PSYCHOLOGICAL SCALES, vol. X, no. Y, ص Z-Z, May, 2024.
stats writer. How can font size be changed in base R plots?. PSYCHOLOGICAL SCALES. 2024;vol(issue):pages.
