I would like to construct the following x axis label
bla bla bli bli bla blom bla
(normal normal italic italic normal bold italic)
Is it possible?
Thanks a lot
EDIT: Is it also possible to change the font?
Make Axis Title Text Bold Font with element_text() To make both x and y-axis's title text in bold font, we will use axis. title argument to theme() function with element_text(face=”bold”). Note now both x and y axis's title text are in bold font.
Example 2: Adding an italic Text to ggplot2 Plot. In this example, firstly we will be creating a data frame of 10 elements and plotting it with the help of ggplot() function in the ggplot2 library. And then with the annotate() function and passing the italic parameter in the fontface, we will add italic text to it.
To write text in italic font, use a single underscore or asterix before and after the text. To write text in bold font, use a double asterix or underscores before and after the text.
In charts, axis labels are shown below the horizontal (also known as category) axis, next to the vertical (also known as value) axis, and, in a 3-D chart, next to the depth axis. The chart uses text from your source data for axis labels.
plot(1,1, xlab= expression(bla~bla~italic(bli~bli)~bla~bold(blom)~italic(bla)))
Read the ?plotmath
page for further options.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With