I have this statement in R:
plot(net.trips~step, data=subset1, main="Speed = 1.60",type="b", col=subset1$run)
It will produce five different graphs of time series data (one each for the value of subset1$run
) on one plot in five different colors with points.
However, when I do this to get lines:
plot(net.trips~step, data=subset1, main="Speed = 1.60",type="l", col=subset1$run)
I get a plot with each data series black instead of five different colors.
Why is this happening, and how do I correct it?
Here is some sample data I cooked up:
RUN STEP NUM.TRIPS
1 1 2
1 2 4
1 3 3
2 1 5
2 2 2
2 3 7
There should be two data series on the same plot:
Data series 1: (1,2),(2,4),(3,3)
Data series 2: (1,5),(2,2),(3,7)
What happens is that if I use points (type="b"
), data series 1 and data series 2 will have different colors.
If I use lines (type="l"
), data series 1 and data series 2 will both be black
subset1
actually is. Can you provide a chunk of the file viadput
? – thelatemail