Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to construct an axis label with both normal, italic and bold font

Tags:

graph

plot

r

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?

like image 244
ECII Avatar asked Apr 18 '12 19:04

ECII


People also ask

How do I label the bold axis?

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.

How do I put italics in ggplot2?

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.

How do you make text italic in R?

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.

How are axis labeled?

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.


1 Answers

   plot(1,1, xlab= expression(bla~bla~italic(bli~bli)~bla~bold(blom)~italic(bla)))

Read the ?plotmath page for further options.

like image 75
IRTFM Avatar answered Oct 22 '22 04:10

IRTFM