On 2/12/19 5:08 pm, Rui Barradas wrote:
Hello,
Here are two ways of drawing the lines black and at the same time
removing the lines in the legend. The second way is more idiomatic.
1. Override the colour setting in the ggplot call when drawing the lines:
geom_line(aes(y = y1), colour = "black") +
2. Don't set the colour aesthetic in the initial ggplot call. It will be
needed only to draw the points, so set it in geom_point(). Though it
doesn't influence the lines' colour and the lines in the legend, the
same principle applies to shape = variable so I have moved it to
geom_point().
The complete instruction becomes:
ggplot(long, aes(x, y = value)) +
geom_line(aes(y = y1)) +
geom_point(aes(colour = variable, shape = variable)) +
scale_colour_manual("Doesn't work",values=c("blue","red"),
labels=c("clyde","irving")) +
scale_shape_manual("Doesn't work",values=c(16,3),
labels=c("clyde","irving")) +
facet_grid(cols=vars(grp))
Hope this helps.
Boy did it *ever*!!! Perfect. Thank you *HUGELY*!!!
cheers,
Rolf
--
Honorary Research Fellow
Department of Statistics
University of Auckland
Phone: +64-9-373-7599 ext. 88276
______________________________________________
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.