Open mugekosar opened 2 years ago
Hi @lecy and @jamisoncrawford,
I tried to add legends with geom_segment() and annotate() functions and it worked!
Glad you got this working! That's certainly one viable approach.
The conventional way to ensure ggplot()
automatically adds a legend is to include color =
or fill =
in the aes()
function inside your geom_*()
layer. You can suppress it with show_legend = FALSE
(IIRC) and you can relabel the legend in the labs()
function, using plot + labs(color = "tomato")
, for example.
Thank you for your explanation! @jamisoncrawford
Hi @lecy,
I'm trying to add a legend for regions. I have tried following functions into aes() function but I'm not able to add a legend. group= color= fill=
Should I add legends in a different way? Can you please help me in understanding which part I'm doing wrong?
Thanks!