• 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 Text Bold in ggplot2

datavizpyr · August 26, 2021 ·

In this tutorial, we will learn how to make the axis text bold in a plot made with ggplot2 in R. Axis text in a plot refers to the text annotating the tick marks on x and y-axis. By default the axis text around tick marks are not in bold font and here we will make the axis text bold font using ggplot2’s theme element element_text().

How To Make Axis Text Bold in ggplot2
How To Make Axis Text Bold in ggplot2 with element_text()

Loading Data

First, let us load tidyverse and palmer penguin dataset to make plots using ggplot2.

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

A plot with default axis text in ggplot2

Let us make a scatter plot using Palmer penguin data set to see how axis text looks like by default with ggplot2.

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

Simple plot with ggplot2 in R
Simple plot with ggplot2 in R

How to Make Axis Text Bold Font: element_text in ggplot2

We can make axis text, text annotating x and y axis tick marks, bold font using theme() function. Here we specify axis.text argument to make both x and y-axis text bold using element_text() function. We can make the axis text font bold by using face=”bold” argument to element_text() function.

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

Note now the both x and y-axis text are in bold font and more clearly visible than the default axis text.

How to Make Axis Text Bold with ggplot
Make Axis Text Bold with ggplot2

One can also make the axis text on one of the axes selectively. For example, by using axis.text.x = element_text(face=”bold”) we can make x-axis text bold font. Similarly, by using axis.text.y = element_text(face=”bold”), we can make y-axis text bold font.

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 Make Axis Title Bold Font with element_text()How to Make Axis Title Bold Font with ggplot2

Filed Under: ggplot2, R Tagged With: axis text bold font in R, axis text 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