smoothly explore data points on the plot

11 visualizzazioni (ultimi 30 giorni)
기현
기현 il 17 Dic 2024
Commentato: 기현 il 31 Dic 2024
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 Commenti
Divyajyoti Nayak
Divyajyoti Nayak il 24 Dic 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.
기현
기현 il 25 Dic 2024
Modificato: Walter Roberson il 25 Dic 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.

Accedi per commentare.

Risposta accettata

Sumukh
Sumukh il 31 Dic 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.

Più risposte (0)

Prodotti


Release

R2024b

Community Treasure Hunt

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

Start Hunting!

Translated by