MATLAB: Plot few (x,y) co-ordinates in different colours

plotting in different colours

how to plot all (x,y) co-ordinates in one colour initially and later plot few (x,y) co-ordinates in one colour and other co-ordinates in different colour in the same figure?

Best Answer

Here are two ways:
figure
hold on
plot(rand(1,4))
plot(rand(1,4))
figure
plot(1:4,rand(1,4),'r',1:4,rand(1,4),'g')
You could also use the scatter command.
Related Question