My data looks something like this:
x = A, A, B, C, D, E, E, F, G y = 1, 0, 2, 3, 4, 5, 0, 6, 7
How do I have every alternate x-axis data point a different colour? For example, in my data, I would like to have the A, C, E and G points one colour, B, D, F another and then have the points where the value is 0 a third colour? I've used pch =
and col=
to change the colour and shape of everything, but is it possible to change specific points?
Or would I have to plot two different graphs on the same plot, and then change the colour of each graph, then have a third rule for the zeroes? The only problem with this is that since my variables are not numerical, and the data needs to be alternating, I can't seem to figure out how to plot it.