Graphic title bar in ggplot2

2

I made this chart with geom_bar() , I would like the title (a) to follow the direction of ylab , but I can not.

I used this parameter of the function geom_bar()

theme(plot.title = element_text(hjust = 0, size = 13))

I get this result:

Iwouldlikethetitletobealignedwithylab,asfollows:

How to proceed? using hjust = 0 , I expected that the title already aligned with the ylab margin, but it does not happen, I tried negative values too and I could not.

    
asked by anonymous 19.09.2018 / 23:38

1 answer

2

The values of hjust can be negative for you to do what you need.

For example:

library(ggplot2)

ggplot(iris, aes(x = Species)) +
  geom_bar() +
  ggtitle("Titulo") + 
  theme(plot.title = element_text(hjust = -0.07, size = 13))

    
20.09.2018 / 01:41