Hi experts I want to have a plot, which consist of line and points something like this: plot(data, type="o") but I would like that lines and point have different colors. for example line should be blue and points should be black how can I do that in R? [[alternative HTML version deleted]]
Jim Lemon
2014-Mar-05 10:02 UTC
[R] Having a plot with points and line with different colors
On 03/05/2014 08:59 PM, Baro wrote:> Hi experts > > I want to have a plot, which consist of line and points something like this: > > plot(data, type="o") > > but I would like that lines and point have different colors. for example > line should be blue and points should be black > > how can I do that in R? >Hi Baro, There are a few ways to do this, here are two. Probably the easiest is to plot the lines, then add the symbols with "points", allowing the line to have one color and the point another. You can overplot the "o" type of plot with points of a different color, but this occasionally leads to color bleed on the points if the overplotting is not exact. Jim