Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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.

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!
like image 266
theforestecologist Avatar asked Jan 18 '26 00:01

theforestecologist


1 Answers

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

like image 70
bretauv Avatar answered Jan 20 '26 16:01

bretauv



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!