• 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
  • Python Viz
  • Seaborn
  • Altair
  • R Viz
  • ggplot2
  • About
    • Privacy Policy
  • Show Search
Hide Search

How to make axis tick label bold

datavizpyr · October 5, 2024 ·

In this post, we learn how to make axis tick labels bold in ggplot2 R. If you wonder what are axis tick labels, they are the text labels that appear right below the tick marks on a graph’s x and y axes. These labels play an omportant role in helping interpret the values represented on the axes. This, making the tick labels bold can enhance the plot made with ggplot2.

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

How to make axis tick labels bold?

Let us use a scatter plot made with ggplot2 to show how to make the axis tick labels bold.

penguins |>
  ggplot(aes(body_mass_g, bill_length_mm, color=species))+
  geom_point()+
  labs(title="How to make axis tick labels bold in ggplot2")
ggsave("how_to_make_axis_tick_labels_bold_ggplot2.png")

Notice that the tick labels are not bold by default in ggplot.

How to Make Axis Tick Labels Bold in ggplot2?
How to Make Axis Tick Labels Bold in ggplot2?

Make x-axis tick labels bold using axis.text.x

ggplot2 offers great controls over how to customize axis tick labels. If you are interested in just making the x-axis tick labels, we can use axis.text.x as argument to theme() function as shown below. In the examples we use in this post, we have also changed the tick label size using size argument to element_text().

penguins |>
  ggplot(aes(body_mass_g, bill_length_mm, color=species)) +
  geom_point() +
  theme(axis.text.x= element_text(size=15, 
                                     face="bold"))+
  labs(title=stringr::str_wrap("Make x-axis tick label 
                                bold in ggplot2 with element_text()", width=40)) 
ggsave("make_x_axis_tick_labels_bold_ggplot2_using_theme.png")
Make x-axis Tick Labels Bold in ggplot2 with element_text()
Make x-axis Tick Labels Bold in ggplot2 with element_text()

Make y-axis tick labels bold using axis.text.y

Similarly, we can make the y-axis tick labels bold, by using axis.text.y as argument to theme() function as shown below.

penguins |>
  ggplot(aes(body_mass_g, bill_length_mm, color=species))+
  geom_point() +
  theme(axis.text.y= element_text(size=15, 
                                     face="bold"))+
  labs(title=stringr::str_wrap("Make y-axis tick label 
                                bold in ggplot2 with element_text()", width=40)) 
ggsave("make_y_axis_tick_labels_bold_ggplot2_using_theme.png")
Make y-axis Tick Labels Bold in ggplot2 with element_text()
Make y-axis Tick Labels Bold in ggplot2 with element_text()

Make both the axes tick labels bold using axis.text

To make both the axes’ tick labels bold, by using axis.text as argument to theme() function with element_text() function. In the examples we also set the size of the axis tick labels as shown below.

penguins |>
  ggplot(aes(body_mass_g, bill_length_mm, color=species))+
  geom_point() +
  theme(axis.text= element_text(size=15, 
                                face="bold"))+
  labs(title=stringr::str_wrap("Make axis tick label 
                                bold in ggplot2 with element_text()", width=40)) 
ggsave("make_axis_tick_labels_bold_ggplot2_using_theme.png")
Make Axis Tick Labels Bold in ggplot2 with element_text()
Make Axis Tick Labels Bold in ggplot2 with element_text()

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: make axis tick labels bold

Primary Sidebar

Tags

Altair barplot Boxplot boxplot python boxplot with jiitered text labels Bubble Plot Color Palette Countplot Density Plot Facet Plot gganimate ggplot2 ggplot2 Boxplot ggplot2 error ggplot boxplot ggridges ggtext element_markdown() Grouped Barplot R heatmap heatmaps Histogram Histograms Horizontal boxplot Python lollipop plot Maps Matplotlib Pandas patchwork pheatmap Pyhon Python R RColorBrewer reorder boxplot ggplot Ridgeline plot Scatter Plot Scatter Plot Altair Seaborn Seaborn Boxplot Stock Price Over Time Stripplot UpSetR Violinplot Violin Plot World Map ggplot2

Buy Me a Coffee

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

Go to mobile version