how to get the co-ordinate values & labels when click on the plotted line?

G
Gracesmith9 · Sep 11, 2020 · 1.9K views
Question
i have plotted 3 signals(eg:3 straight lines) on axes(or figure) how can i get the x,y values & the name of the signal when i click on the particular plotted line
Expert Answer
Profile picture of Kshitij Singh
Kshitij Singh PhD Expert
Answered Aug 13, 2026

try this code:

   a=[1 2 3 4];
   b=[5 6 7 8];
   plot(a,b)
  legend('signal1');

After this, goto Tools in plotted graph, Enable Data cursor and then Options --> Enable display cursor in window. You can see the results seperate window

100% Run Guarantee 3-Hour Fast-Track Delivery

Need a Custom Version or Complete Simulation for This Problem?

Our 500+ PhD engineers build, debug, and optimize working MATLAB scripts and Simulink (.slx) models tailored to your exact assignment rubrics with zero plagiarism.

Tested on MATLAB R2024b / R2026a
Turnitin 0% Plagiarism Report
Free 7-Day Revisions Guarantee
Have a different question? Ask here

Get a Free Consultation or a Sample Assignment Review!