scatterplot(x, n, offset, plotstring, scatfig)
-
The input vector x is a column of complex numbers, or two columns of real numbers, as the horizontal and vertical coordinates of the graph.
-
n represents to draw a point every few elements for the input x.
-
offset represents the beginning of the drawing from the (offset+1)th element of x.
-
plotstring represents color, line shape, and point type, just like the plot function. But because it is a scatter plot, linearity is generally not specified, otherwise the scattered points will be connected.
-
The scatfig
drawing function actually has a return value. a = scatterplot(); returns a scatterplot object.
When you want to draw multiple sets of data in the same scatter chart, you need to use the following syntax:
sPlotFig = scatterplot(dataModG,1,0,'r+');
hold on
scatterplot(dataModG1,1,0,'bo',sPlotFig);
scatterplot(dataModG2,1,0,'k.',sPlotFig);
legend('Original data', 'Damage data','Recovery data','Location','Best')
hold off