Skip to content

Data Science Tutorials

For Data Science Learners

  • How to Add a title to ggplot2 Plots in R
    How to Add a caption to ggplot2 Plots in R? R
  • How to Calculate Ratios in R
    How to Calculate Ratios in R R
  • Calculate the P-Value from Chi-Square Statistic in R
    Calculate the P-Value from Chi-Square Statistic in R R
  • How to get the last value of each group in R
    How to get the last value of each group in R R
  • Dealing Missing values in R
    Dealing With Missing values in R R
  • Top Data Science Examples You Should Know 2023
    Top Data Science Applications You Should Know 2023 Machine Learning
  • How to Turn Off Scientific Notation in R
    How to Turn Off Scientific Notation in R? R
  • Data Science Challenges in R Programming Language
    Data Science Challenges in R Programming Language Machine Learning
How to Use Bold Font in

How to Use Bold Font in R with Examples

Posted on September 26September 23 By Admin No Comments on How to Use Bold Font in R with Examples

How to Use Bold Font in R, to create a bold typeface in R plots, use the basic syntax shown below:

substitute(paste(bold('datasciencetut.com')))

These examples demonstrate how to apply this syntax in real-world situations.

Example 1: Plot’s axis labels in bold font

The code below demonstrates how to make a scatter plot in R with both axis labels in regular font:

How to Use Bold Font in R, First define data

x <- c(1, 2, 3, 4, 4, 5, 6, 6, 7, 9)
y <- c(38, 58, 55, 60, 65, 52, 40, 45, 34, 57)

To make a scatter plot with axis labels in regular font.

plot(x, y, xlab='X Label', ylab='Y Label')

Additionally, the code below demonstrates how to set bold font for a plot’s x-axis and y-axis labels:

plot(x, y, xlab = substitute(paste(bold('X Label'))),
           ylab = substitute(paste(bold('Y Label'))))

The labels for both axes are now bold, as you can see.

Example 2: Bold Font with Text in Plot

Let’s add normal text at location x=3, y=54

text(3, 54, 'datasciencetut.com')

Now we can add bold text at location x=6, y=64

text(6, 64, substitute(paste(bold('datasciencetut.com'))))

Take note of how the bold font differs from the regular type.

Check your inbox or spam folder to confirm your subscription.

Further Resources:-
The following tutorials provide guidance on using R to learn:

Change ggplot2 Theme Color in R- Data Science Tutorials

Best GGPlot Themes You Should Know – Data Science Tutorials

How to Label Outliers in Boxplots in ggplot2? (datasciencetut.com)

R

Post navigation

Previous Post: Changing the Font Size in Base R Plots
Next Post: How to Use Italic Font in R

Related Posts

  • How to Create an Interaction Plot in R
    How to Create an Interaction Plot in R? R
  • Ogive Graph in R
    Ogive Graph in R R
  • Duplicate and concatenate in R R
  • Calculating Z-Scores in R: A Step-by-Step Guide R
  • How to remove files and folders in R
    How to remove files and folders in R R
  • one-sample-proportion-test-in-r
    One sample proportion test in R-Complete Guide R

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

  • Best Prompt Engineering Books
  • Understanding Machine Learning and Data Science
  • Best Git Books
  • Top 5 Books to Learn Data Engineering
  • Mastering R Programming for Data Science: Tips and Tricks
  • About Us
  • Contact
  • Disclaimer
  • Privacy Policy

https://www.r-bloggers.com

  • YouTube
  • Twitter
  • Facebook
  • Course
  • Excel
  • Machine Learning
  • Opensesame
  • R
  • Statistics

Check your inbox or spam folder to confirm your subscription.

  • The Ultimate Guide to Becoming a Data Analyst
    The Ultimate Guide to Becoming a Data Analyst: A Step-by-Step Process Machine Learning
  • Change ggplot2 Theme Color in R
    Change ggplot2 Theme Color in R ggthemr Package R
  • Normal distribution in R
    Normal Distribution in R R
  • Interactive 3d plot in R
    Interactive 3d plot in R-Quick Guide R
  • Box Cox transformation in R
    Box Cox transformation in R R
  • How to Filter Rows In R
    How to Filter Rows In R? R
  • Return the corresponding value of Cauchy density in R
    Return the corresponding value of Cauchy density in R R
  • How to Join Multiple Data Frames in R
    How to Join Multiple Data Frames in R R

Privacy Policy

Copyright © 2025 Data Science Tutorials.

Powered by PressBook News WordPress theme