Why is the SCATTER function much slower than the PLOT function in MATLAB?

I am plotting a large number of data points with the SCATTER function, and I would like to know why it takes much longer to use SCATTER than to use PLOT (with no LineStyle) for the same data.

 採用された回答

MathWorks Support Team
MathWorks Support Team 2009 年 6 月 27 日

0 投票

The SCATTER function creates a patch object for each data point, not a line object. Using PLOT with the same data creates a single line object. Therefore, even though each individual patch object might be simpler than the line object, the combination of the number of patch objects to be created, and the calculations necessary to determine the data used to create each patch, make the SCATTER function slower than PLOT.

その他の回答 (0 件)

カテゴリ

製品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by