ggplot will assign, or map if you will, the color based on the default
color scale when color is specified with the mapping argument such as
mapping = aes(color=...). You have two options:
1. if you want the color of your arrow to be based on a column in your
data, then manually scale the color
Here are 2 solutions to you problem:
If you only want to use one color (for possibly many arrows),
this will work:
ggplot()+geom_segment(mapping = aes(x = as.Date(test[,"date"]),
y =y1,
xend = as.Date(test[,"date"]),
Hi,
I have a dataset "test". I try to produce a "green" arrow but it gives a
"red" arrow (as attached). Could someone tell me how I can fix it? Thanks,
> test
dateco y1 y2
5 2011-11-28 green 196.6559 1.600267
> dput(test)
structure(list(date = structure(15306, class =
3 matches
Mail list logo