79573943

Date: 2025-04-14 20:15:58
Score: 0.5
Natty:
Report link

If you assign a guide to each plot and give them unique titles, you get just two legends

p3 <- p1 +  
  guides(
    color = guide_legend( title = "condition 1" ) 
    )+
  ggnewscale::new_scale_color() +
  geom_point(
    data = mydata
    , aes(
      x = x
      , y = y
      , group = 1
      , col = new_sample_name
      )
    ) +
  guides(color = guide_legend(title = "new name"))

enter image description here

Reasons:
  • Probably link only (1):
  • Has code block (-0.5):
Posted by: Michiel Duvekot