• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

Data Viz with Python and R

Learn to Make Plots in Python and R

  • Home
  • Seaborn
  • Matplotlib
  • ggplot2
  • Altair
  • About
    • Privacy Policy
  • Visualizing Activation Functions in Neural Networks
  • Confusion Matrix Calculator
  • Visualizing Dropout Rate in Neural Network
  • Visualizing Loss Functions in Neural Networks
  • Show Search
Hide Search

How to Make Axis Title Bold Font with ggplot2

datavizpyr · September 6, 2021 ·

Last updated on September 9, 2021

In this tutorial, we will learn how to change the axis title bold font with ggplot2 in R. Let us load the packages needed including tidyverse and palmerpenguins for penguins data.

library(tidyverse)
library(palmerpenguins)
theme_set(theme_bw(16))

A plot with default font for axis title text

Let us make a simple scatter plot using ggplot2 to see how the default font for both x and y-axis title looks like.

penguins %>% 
  drop_na() %>%
  ggplot(aes(x = flipper_length_mm,
             y = bill_length_mm,
             color = species)) + 
   geom_point() 
ggsave("how_to_make_axis_title_bold_font_ggplot2.png")

How to Make Axis Title Bold Font in ggplot2
How to Make Axis Title Bold Font in ggplot2

Make Axis Title Text Bold Font with element_text()

We can change the appearance text elements of a plot made with ggplot2 using theme element element_text() function. To make both x and y-axis’s title text in bold font, we will use axis.title argument to theme() function with element_text(face=”bold”).

penguins %>% 
  drop_na() %>%
  ggplot(aes(x = flipper_length_mm,
             y = bill_length_mm,
             color = species)) + 
   geom_point() +
  theme(axis.title = element_text(face="bold"))
ggsave("make_axis_title_bold_font_ggplot2.png")

Note now both x and y axis’s title text are in bold font.

Make Axis Title Bold Font with element_text()
Make Axis Title Bold Font with element_text()

Make X and Y Axis Title Text Bold Font Separately with element_text()

In the above example, we changed both x and y-axis’s title text into bold. We can also specify either x or y-axis alone to customize the look of text using element_text(). For example, to make the title text of x-axis aloine in bold font, we will use “axis.title.x”

penguins %>% 
  drop_na() %>%
  ggplot(aes(x = flipper_length_mm,
             y = bill_length_mm,
             color = species)) + 
   geom_point() +
  theme(axis.title.x = element_text(face="bold"))

Similarly, to make the y-axis title text’s font into bold we can use “axis.title.y” as shown below.

penguins %>% 
  drop_na() %>%
  ggplot(aes(x = flipper_length_mm,
             y = bill_length_mm,
             color = species)) + 
   geom_point() +
  theme(axis.title.y = element_text(face="bold"))

Explore the Complete ggplot2 Guide

35+ tutorials with code: scatterplots, boxplots, themes, annotations, facets, and more—tested and beginner-friendly.

Visit the ggplot2 Hub → No fluff—just code and visuals.

Related posts:

Customizing Mean mark to boxplot with ggplot2How To Show Mean Value in Boxplots with ggplot2? Scatterplot with marginal multi-histogram with ggExtraHow To Make Scatterplot with Marginal Histograms in R? ggforce geom_circle(): Annotate with a circleHow To Annotate a Plot with Circle in R Default ThumbnailHow to Make Axis Text Bold in ggplot2

Filed Under: ggplot2, R Tagged With: axis title bold element_text, axis title bold ggplot2

Primary Sidebar

Python & R Viz Hubs

  • Seaborn Guide & Cookbook
  • ggplot2 Guide & Cookbook
  • Matplotlib Guide & Cookbook
  • Confusion Matrix Calculator
  • Visualizing Activation Functions
  • Visualizing Dropout
  • Visualizing Loss Functions

Buy Me a Coffee

Copyright © 2026 · Daily Dish Pro on Genesis Framework · WordPress · Log in

Go to mobile version