Home > Software design >  How to adjust legend for a colour-shape combiation in ggplot2?
How to adjust legend for a colour-shape combiation in ggplot2?

Time:10-07

I would like to rename the title and labels of this legend combining shape and colour elements.

data <- data.frame(x = rep(seq(from=10, to=100, by=10), each=2),
                   y = runif(20,0,1),
                   group = rep(0:1,20))

data %>% 
  ggplot(aes(x=x, y=y, col=factor(group), shape=factor(group)))  
  geom_point(size=3)   geom_line()

enter image description here

I have tried this post enter image description here

  • Related