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개)

카테고리

도움말 센터File Exchange에서 Scatter Plots에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by