smoothly explore data points on the plot

11 views (last 30 days)
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 Comments
Divyajyoti Nayak
Divyajyoti Nayak on 24 Dec 2024
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.
기현
기현 on 25 Dec 2024
Edited: Walter Roberson on 25 Dec 2024
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.

Sign in to comment.

Accepted Answer

Sumukh
Sumukh on 31 Dec 2024
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.

More Answers (0)

Products


Release

R2024b

Community Treasure Hunt

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

Start Hunting!