Skip to content

Data Science Tutorials

  • Home
  • R
  • Statistics
  • Course
  • Machine Learning
  • Guest Blog
  • Contact
  • About Us
  • Toggle search form
  • How to Rank by Group in R?
    How to Rank by Group in R? R
  • Crosstab calculation in R
    Crosstab calculation in R R
  • Defensive Programming Strategies in R
    Defensive Programming Strategies in R Machine Learning
  • How to Replace Inf Values with NA in R
    How to Replace Inf Values with NA in R R
  • Convert Multiple Columns to Numeric in R
    Convert Multiple Columns to Numeric in R R
  • How to change the column positions in R?
    How to change the column positions in R? R
  • Count Observations by Group in R
    Count Observations by Group in R R
  • Detecting and Dealing with Outliers
    Detecting and Dealing with Outliers: First Step R
How to Use Bold Font in

How to Use Bold Font in R with Examples

Posted on September 26September 23 By Jim No Comments on How to Use Bold Font in R with Examples
Tweet
Share
Share
Pin

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)

Tweet
Share
Share
Pin
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 Scale Only Numeric Columns in R
    How to Scale Only Numeric Columns in R R
  • droplevels in R with examples
    droplevels in R with examples R
  • Difference between R and Python
    Difference between R and Python R
  • Add Significance Level and Stars to Plot in R
    Add Significance Level and Stars to Plot in R R
  • How to Create Summary Tables in R
    How to Create Summary Tables in R R
  • How to perform MANOVA test in R
    How to perform the MANOVA test in R? R

Leave a Reply Cancel reply

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

  • About Us
  • Contact
  • Disclaimer
  • Guest Blog
  • Privacy Policy
  • YouTube
  • Twitter
  • Facebook
  • Defensive Programming Strategies in R
  • Plot categorical data in R
  • Top Data Modeling Tools for 2023
  • Ogive Graph in R
  • Is R or Python Better for Data Science in Bangalore

Check your inbox or spam folder to confirm your subscription.

  • Data Scientist Career Path Map in Finance
  • Is Python the ideal language for machine learning
  • Convert character string to name class object
  • How to play sound at end of R Script
  • Pattern Searching in R
  • Data Science Challenges in R Programming Language
    Data Science Challenges in R Programming Language Machine Learning
  • Get the first value in each group in R
    Get the first value in each group in R? R
  • sorting in r
    Sorting in r: sort, order & rank R Functions R
  • Artificial Intelligence Examples
    Artificial Intelligence Examples-Quick View Course
  • How to compare variances in R
    How to compare variances in R R
  • Convert multiple columns into a single column
    Convert multiple columns into a single column-tidyr Part4 R
  • Two-Way ANOVA Example in R
    How to perform a one-sample t-test in R? R
  • How to perform TBATS Model in R
    How to perform TBATS Model in R R

Copyright © 2023 Data Science Tutorials.

Powered by PressBook News WordPress theme