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

조회 수: 13 (최근 30일)
z8080
z8080 2020년 1월 24일
댓글: Adam Danz 2021년 1월 7일
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
Adam Danz 2021년 1월 7일
Keyboard control of datatips is not supported in scatter(). See this answer for a workaround using scatter.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Scatter Plots에 대해 자세히 알아보기

태그

제품


릴리스

R2016a

Community Treasure Hunt

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

Start Hunting!

Translated by