Subtitles by GGPLOT2

Asked

Viewed 693 times

2

I have this graph created by the geom_bar function():

inserir a descrição da imagem aqui

I would like to separate the two boxes where are plotted to Fill, as follows:

inserir a descrição da imagem aqui

How do I do this? which parameter of the Theme() function can I use to solve this problem?

1 answer

1


The attribute legend.key.size changes the distance between the elements a little. See if it fits you:

library(ggplot2)
ggplot(iris, aes(x = Sepal.Length, y = Petal.Length, color = Species)) +
  geom_point() +
  theme(
    legend.key.size = unit(3, 'lines')
    )

inserir a descrição da imagem aqui

Here the reference in English.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.