Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How do I make text bold AND italics at same time in base R plot?

Let’s say I have a plot:

plot(1:5,1:5, main = "Plot Title here")

How do I make my main title both bold and italic?

I can make it bold or italic, but I’ve been unable to acheive both simultaneously.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

main = expression(italic("Plot Title here"))          #makes italic
main = expression(bold("Plot Title here"))            #makes bold
main = expression(bold(italic("Plot Title here")))    #still only makes italic!

>Solution :

From ?plotmath:

main = expression(bolditalic("Plot Title here"))   
plot(1:5,1:5, main = main)

Created on 2023-04-03 with reprex v2.0.2

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading