0
   ggplot() + 
     geom_point(data = tab[tab$A < 0.1, ], aes(x = V3,  y = V2), col = "gray55", pch = 20, cex = 2, alpha = 0.3) + 
     geom_point(data = tab[tab$A >= 0.1, ], aes(x = V3, y = V2,  color = A)) + 
     scale_colour_gradient(low = "gold", high = "red") + 
     geom_point(data = tab[tab$B >= 0.1, ], aes(x = V3, y = V2, color = B)) + 
     scale_color_gradient(low = "deepskyblue",  high = "deepskyblue4") + 
     geom_point(data = tab[tab$label == "C", ], aes(x = V3, y = V2), col = "black", pch = 21, fill = "green", cex = 2) + 
     theme_bw() + 
     theme(panel.border = element_blank(), 
       panel.grid.major = element_blank(), 
       panel.grid.minor = element_blank(), 
       axis.line = element_line(colour = "black")
     )

But I got this error:

Scale for 'colour' is already present. Adding another scale for 'colour', which will replace the existing scale.

Do you know if it is possible to use two different scale_color_gradients in order to have two different gradients in the same plot? Thank you.

MrFlick
  • 195,160
  • 17
  • 277
  • 295
user40267
  • 51
  • 2
  • 5

0 Answers0