Clear Filters
Clear Filters

Why is scatter slow to pan and zoom

2 views (last 30 days)
John Videtich
John Videtich on 24 Mar 2017
Commented: Matt J on 24 Mar 2017
Hello, I'm using R2017 and am using numerous plot functions. I've just found that "scatter" seems to really limit how quickly I can navigate around on a plot. It doesn't seem to be my particular plot; it seems to be related to "scatter" only.
Example - compare panning a line plot and scatter plot (or zooming with the mouse wheel):
figure;
x = linspace(0,3*pi,200);
y = cos(x) + rand(1,200);
scatter(x,y);
title( 'Scatter' );
pan on
figure;
x = 0:pi/100:2*pi;
y = sin(x);
plot(x,y);
title( 'Line' );
pan on
figure;
plot(x,y);
hold on
s = scatter(0,0,100,'>');
s.LineWidth = 2;
s = scatter(pi/2,1,100,'h');
s.LineWidth = 2;
s = scatter(pi,0,100,'+');
s.LineWidth = 2;
s = scatter(3*pi/2,-1,100,'^');
s.LineWidth = 2;
s = scatter(2*pi,0,100,'*');
s.LineWidth = 2;
title( 'Line & scatter' );
pan on
I'm only using scatter for 5-30 points, each with a different marker (new call to "scatter"). It gets progressively worse past 5 or 10 points. But it only takes 1 to significantly slow down pan/zoom update rates.
Any suggestions?
Thanks!
- John
  1 Comment
Matt J
Matt J on 24 Mar 2017
Hmmm. I'm not seeing any noticeably slow behavior. I would expect scatter to be slower on some time scale because you have more graphics objects in that plot, but it's not perceptible to me when manually panning/zooming.
A complete reboot of the computer might be something to try.

Sign in to comment.

Answers (0)

Community Treasure Hunt

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

Start Hunting!