smoothly explore data points on the plot

조회 수: 12 (최근 30일)
기현
기현 2024년 12월 17일
댓글: 기현 2024년 12월 31일
After reinstalling MATLAB, I noticed a change in the behavior of the margin, rlocus, nyquist function. Previously, when I plotted using margin, rlocus, nyquist the cursor could smoothly explore data points on the plot without any special commands. However, after reinstalling, the cursor now moves in larger steps, and the plot appears to have a lower density. I would like to restore the previous behavior where the plot had higher density and the cursor moved smoothly. How can I achieve this?
  댓글 수: 2
Divyajyoti Nayak
Divyajyoti Nayak 2024년 12월 24일
Hi @기현 남, could you mention which older version of MATLAB you were working with? I tested out these functions with R2024a and R2023a, and the cursor works the same for both. Some sample code would also be helpful.
기현
기현 2024년 12월 25일
편집: Walter Roberson 2024년 12월 25일
i'm using 20204b, for example,
num=[1];
den=[1 1 1];
sys=tf(num, den);
margin(sys)
In the plot, the frequency values seem to skip directly from 4.78 to 5.59, even though the graph visually shows the intermediate values. However, when hovering the mouse cursor, it skips over those values.

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

채택된 답변

Sumukh
Sumukh 2024년 12월 31일
I am assuming that you are referring to the behaviour of data tips on the plot. I am able to reproduce the issue in MATLAB R2024b and it is true that when clicked on the plot, the nearest data tip gets pinned instead of the selected data point.
This is an expected behaviour of data tips and is related to the "SnapToDataVertex" property as specified in the following documentation for datatip:
This property is enabled by default and it allows the user to display the nearest data tip to the selected data point.
Kindly refer to the following steps to disable this property within the plot itself:
  1. After the creation of the plot using either of the commands specified, click on a data point of the plot to create a random data tip.
  2. Right-click on the data tip > "Selection Style" > Select "Mouse Position" option instead of "Snap to Nearest Data Vertex" selected by default.
  3. Now it is possible to create a data tip for any data point on the plot within the current figure opened.
I hope this resolves your issue.
  댓글 수: 1
기현
기현 2024년 12월 31일
thank you very much it works well

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Classical Control Design에 대해 자세히 알아보기

제품


릴리스

R2024b

Community Treasure Hunt

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

Start Hunting!

Translated by