Can I use arrows to move Data Tips on scatter plots?
Show older comments
I know that when using the plot function with data tips you can use the arrow keys to move the data tip through the data set. Is there a way to do this with scatter plots as well? I need to be able to define the marker color individually, which is why I'm using scatter instead of plot.
Accepted Answer
More Answers (1)
It appears that keyboard control of DataTips is not supported in scatter().
However, a less-than-perfect workaround is to plot very small (nearly invisible) points on top of the scatter markers using plot() which will support keyboard control of DataTips.
Demo:

% rng('default') % for reproducibility
x = linspace(0,2*pi,25);
y = cos(x) + rand(1,numel(x))/2;
sz = (abs(sin(x))*4+1)*25;
c = linspace(1,10,numel(x));
scatter(x,y,sz,c,'filled','MarkerEdgeColor', 'k')
grid on
% plot() markers must go on top; My tests indicate that marker size
% smaller than 0.5 won't work. Setting Marker style to "none" also
% does not work.
hold on
plot(x,y,'ko','MarkerSize',0.5)
Categories
Find more on Discrete Data Plots in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!