如何将图表名称放在中间?

时间:2019-03-15 04:09:56

标签: r

我做了分析并制作了图表,但图表的名称在左侧,如何将其放置在中间?

qplot(data=d2, dist, xlab="Length of brake path (m)", ylab="Number of vehicles", main="Data from 1920")

1 个答案:

答案 0 :(得分:1)

你可以

qplot(
    data = mtcars,
    as.factor(gear), 
    xlab = "Number of cylinders",
    ylab = "Number of vehicles",
    main = "Data from mtcars") +
theme(plot.title = element_text(hjust = 0.5))

enter image description here