Hi I have the plot below and there are 2 legends showing up. I have a question:
Currently the legend I added has 6 entries "A Value", "Ad value", "au value", "b", "bD Value" and "bU value". I really want to the legend to show only 4 entries
- "A" and in the legend this should be a blue solid line like it already is
- "bd & bu" and in the legend this should be a blue DASHED line ...not sure how to get this
- "A" and in the legend this should be a red solid line like it already is
- "ad & au" and in the legend this should be a red DASHED line...not sure how to implement this
Any thoughts?
d = data.frame (title = c( rep(c("aU","A","ad"),2), rep( c("bU","b","bD"),2 ) ) ,
time = c(1,1,1,2,2,2,1,1,1,2,2,2) ,
value = c(10,8,4,9,7,3,5,3,1,4,2,0))
d
ggplot(data=d , aes(x=time, y=value,
group=title,
colour = title,
linetype =title))+
geom_line() + geom_point() +
scale_colour_manual( name = "Metric",
values = c(
A = "red",
ad = "red",
aU = "red",
b = "blue",
bU ="blue",
bD= "blue"),
labels = c(
A = "A value",
ad = "Ad value",
aU = "au value",
b = "b",
bU ="bU vlaue",
bD= "dD Value")
)+
scale_linetype_manual(name = "Metric",
values =c(
A = "solid",
ad = "dashed",
aU = "dashed",
b = "solid",
bU ="dashed",
bD= "dashed"),
labels = c(
A = "A value",
ad = "Ad value",
aU = "au value",
b = "b",
bU ="bU vlaue",
bD= "dD Value")
)