scatterplot() draw constellation diagram (scatter plot)

scatterplot(x, n, offset, plotstring, scatfig)

  1. 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.

  2. n represents to draw a point every few elements for the input x.

  3. offset represents the beginning of the drawing from the (offset+1)th element of x.

  4. 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.

  5. 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

Insert picture description here

Guess you like

Origin blog.csdn.net/Explore_OuO/article/details/108948193