Consider the following data points and plots
a = randi(50,1,200);
b = randi(50,1,200);
figure;scatter(a,b,'.')
figure;plot(a,b,'.')
When we run the following code , we receive exactly the same plots for a against b , my question is why should we even use or to rephrase again in what conditions scatter
plot has advantage over plot
function ? because plot
seem to have more formatting options that the scatter
function
plot
has a concept of the order of the points mattering so you can use it to make line plots. plot
also allows you to specify the input x
and y
values as either vectors or matrices or allows you to input multiple x
and y
vectors both of which allow you to plot multiple series at once:
whereas scatter only allows you to input 1 x
and 1 y
and they both have to be vectors. However, 'scatter' allows you to specify an area and colour vector to affect the points individually i.e.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With