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

15 vues (au cours des 30 derniers jours)
z8080
z8080 le 24 Jan 2020
Commenté : Adam Danz le 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 commentaire
Adam Danz
Adam Danz le 7 Jan 2021
Keyboard control of datatips is not supported in scatter(). See this answer for a workaround using scatter.

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur Scatter Plots dans Help Center et File Exchange

Tags

Produits


Version

R2016a

Community Treasure Hunt

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

Start Hunting!

Translated by