How can I customly fix the Data cursor location in the Matlab plot?
29 views (last 30 days)
Show older comments
Jaikrishnan Mahalekshmi Sahasranamam
on 17 Jul 2019
Commented: Jaikrishnan Mahalekshmi Sahasranamam
on 5 Aug 2019
I have a plot (attached). In this plot I need to add two data cursors. In one of the data cursor, I need to fix the X value to be 0 and in the other i need to fix the y value to 0. How can I adjust the data cursor points to do so? currently in the first data tip, the Y value is -49.51 and in the other data tip the x value is 0.485. I need to make it in such a way as to keep Y value 0 in first and X value 0 in second. By doing this I will get the corresponding X value from 1st and corresponding Y value from 2nd
2 Comments
Accepted Answer
Dinesh Yadav
on 2 Aug 2019
I am assuming you have the equation used for plotting. You can feed the value “x=0” in the function to get the value of “y” and vice versa and store these values in variable “pos1” and “pos2”. Without having the values for both “x” and “y” you cannot obtain the DataCursor on the plot.
I am attaching a slightly modified code for your given code with which you can obtain DataCursor at any point of your choice. I have commented few lines that are not needed and changed few lines of code for updating DataCursors.
More Answers (0)
See Also
Categories
Find more on Title in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!