Alex Rivera | Logout

MATLAB - Plot multiple data sets on a scatter plot

Asked 2010-03-20T02:36:21.007
24

I have two sets of data, (Ax, Ay; Bx, By). I'd like to plot both of these data sets on a scatter plot with different colors, but I can't seem to get it to work, because it seems scatter() does not work like plot(). Is it possible to do this?

I've tried...

scatter(Ax, Ay, 'g', Bx, By, 'b')

And

scatter(Ax, Ay, 'g')
scatter(Bx, By, 'b')

The first way returns an error. The latter only plots the Bx/By data.

Edit
Report

1 Answer

39

Try using hold on with the second example.

answered 2010-03-20T02:47:21.487

Your Answer