0

I did this analysis and make a chart but the name of the chart is in left side, how to place it in the middle?

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

1 Answers1

1

You can do

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

Maurits Evers
  • 49,617
  • 4
  • 47
  • 68