Scatter slows down exponentially over time
18 views (last 30 days)
Show older comments
Hello all,
I'm trying to run my code. Within a for loop, it plots x,y using scatter and continues to iterate. My problem is that when I try to see the code running in real-time using pause(1/1000000) (1 microsecond delay), the code starts slowing down exponentially upto the point that each scatter plots takes 1 second or more to appear on the graph. I timed my code and there is nothing slowing it down except scatter. Help is greatly appreciated.
performed a tic/toc of the scatter, results are attached.
2 Comments
Walter Roberson
on 12 Nov 2019
In other words, reduce the number of scatter objects -- they are expensive. You could aim for one per marker shape (okay, another layer for filled or not, and possibly one branch per marker edge color)
If I recall correctly from some old blog posts, after 100 points in a scatter object, scatter internally switches to patch representation.
Answers (1)
See Also
Categories
Find more on Graphics Performance in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!