r - Delete one aes from legend generated from two layes sharing common aes name -


My question is that I want to overlay a scatter plot at the top of a line plot and change the color of these two plots. With a variable I want to keep the legend for only one color, if I use scale_colour_discrete (guide = "none") then will both have gone.

An example of a copy is:

  Library (reshape2) IRIS2 and LT; - Melt (iris, id.over = "species") GG Plot (Iris 2, AES (X = Variable, Y = Value, Group = Species)) + GOM_point (AES (Color = IFLSE (Value <3, "Type I want to show the legend for 'species' rather than just type.  

setting show_guide = FALSE in the geom_point layer,

 GEGPlot (IIS2, AES (X = variable, Y = value, group = species)) + GOM_point (AES (color = FLSE (value <3, "type1", "type2")), Show_guide = False) + Geom_line (AES (color = species)) + scale_colour_discrete ("species", breaks = level (iris 2 $ species))   

 Enter image details here

Comments

Popular posts from this blog

php - PDO bindParam() fatal error -

logging - How can I log both the Request.InputStream and Response.OutputStream traffic in my ASP.NET MVC3 Application for specific Actions? -

java - Why my included JSP file won't get processed correctly? -