Data Cursor not moving upon pressing the arrow keys in scatter plot
2 次查看(过去 30 天)
显示 更早的评论
I find the Data Cursor in Matlab a very powerful tool when plotting data and debugging code. However, it often does not behave as expected. For instance, consider the following minimal example:
x = randn(1,10);
y = randn(1,10);
scatter(x,y)
If I click on a data point with the Data Cursor, and then press any of the arrow keys on my keyboard, the data cursor does not move between the different data points plotted, as would be expected, and as indeed happens in other of my scatter plots (with code too complex to paste here).
If I change the scatter to a plot, with data points not connected by a line,
plot(x,y, 'o')
then the Data Cursor moves again when pressing the arrows. However, the scatter function has features that the plot function does not have. I didn't find it written anywhere in matlab's documentation that data cursor does not work with 'scatter'.
Any ideas when/why this happens, would be really appreciated. I am using Matlab 2016a on Windows.
1 个评论
Adam Danz
2021-1-7
Keyboard control of datatips is not supported in scatter(). See this answer for a workaround using scatter.
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Matrix Indexing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!