Bold labeling in R

Does anyone know how to safeguard the axis labels xand y("Single Sample" and "Value Axis") in the R box?

Here is what my boxplot looks like: http://img822.imageshack.us/img822/331/23807704.png

+3
source share
1 answer

Using this sample data:

dat <- data.frame(values = c(rnorm(100, mean = 1), rnorm(100, mean = 3),
                             rnorm(100, mean = 4, sd = 3)),
                  groups = factor(rep(c("aaa","bbb","ccc"), each = 100)))

There are several ways. One of them is to use the features ?plotmathand functions plotmath" bold()in the expression:

boxplot(values ~ groups, data = dat,
        ylab = expression(bold(Value~axis)),
        xlab = expression(bold(Single~sample)))

or similarly

boxplot(values ~ groups, data = dat,
        ylab = expression(bold("Value axis")),
        xlab = expression(bold("Single sample")))

Another way is to leave the headings on the chart, and then add them using the function title()in bold:

boxplot(values ~ groups, data = dat)
title(ylab = "Value axis", xlab = "Single sample", font.lab = 2)

font.lab, , . ?par .

+7

Source: https://habr.com/ru/post/1778509/


All Articles