Im want move the lengend name of the top the legend, but I dont know how to make this.
Maybe with legend.position is possible.
library(tidyverse)
# Example data
data <- data.frame(x = 1:3,
y = 1:3,
group = LETTERS[1:3])
ggplot(data, aes(x, y, color = group)) +
geom_point() +
scale_color_manual(values = c("#E41A1C", "#377EBA", "#4BAD4A"), name='')+ # Im change name
theme(legend.position = "bottom")+
labs(x='')
Hi, @M_AcostaCH , you could use theme(legend.margin=margin(-10, 0, 0, 0)) .Follwing is the comparison.
library(tidyverse)
# Example data
data <- data.frame(x = 1:3,
y = 1:3,
group = LETTERS[1:3])
ggplot(data, aes(x, y, color = group)) +
geom_point() +
scale_color_manual(values = c("#E41A1C", "#377EBA", "#4BAD4A"), name='')+ # Im change name
theme(legend.position = "bottom")+
labs(x='')+
theme(legend.margin=margin(-10, 0, 0, 0))