Data Cursor not moving upon pressing the arrow keys in scatter plot

14 Ansichten (letzte 30 Tage)
z8080
z8080 am 24 Jan. 2020
Kommentiert: Adam Danz am 7 Jan. 2021
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 Kommentar
Adam Danz
Adam Danz am 7 Jan. 2021
Keyboard control of datatips is not supported in scatter(). See this answer for a workaround using scatter.

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Tags

Produkte


Version

R2016a

Community Treasure Hunt

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

Start Hunting!

Translated by