How to visualize data names in plots with the data cursor

조회 수: 1 (최근 30일)
Leonardo Vettore
Leonardo Vettore 2016년 7월 2일
댓글: Antonio Rubio 2019년 12월 23일
Let's assume that I have 3 functions plotted in the same figure, named 'a', 'b' and 'c'. While I watch the figure I would like to be able to go over one of the functions with the cursor and see its name. Is it possible maybe to change what the "Data cursor" is displaying and add to the coordinates a custom string? Thank you all!

답변 (1개)

Steven Lord
Steven Lord 2016년 7월 2일
Change the UpdateFcn property of the datacursormode object.
  댓글 수: 2
Leonardo Vettore
Leonardo Vettore 2016년 7월 2일
Can you make an example code? Because I read that, but I don't understand how to pass the names that I want to show to that function
Antonio Rubio
Antonio Rubio 2019년 12월 23일
I'm also trying to solve the same problem on MATLAB R2019a. I have a figure with many different traces and would to display the name of the trace along with the X and Y coordinates. I found one solution that displays the name but in the command window. Another one that allows you to modify the data tip. However I cant figure how to get the data tip to display the name of the trace. Right now the only way to know is if I creat a legend. The problem is there are a lot of traces and the colors repeat. Thank you!

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

카테고리

Help CenterFile Exchange에서 Creating, Deleting, and Querying Graphics Objects에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by