0

I am having a figure in a GUI matlab. When I run my code I make some plots in the figures. The thing is that I want to use my cursor to click on the plot and to display the coordinates but also the label of this point. And for the label I mean this

label x y
first  1.3 4.5
second 2 3.5 

I do not know much about it. Can yyou help me?

4

1 回答 1

0

You could use something like this:

[x,y] = ginput(1);
label = {['label: ', num2str(x), num2str(y)]; 'first  1.3 4.5'; 'second 2 3.5'};
text(x,y,label)

The string in label will be displayed at location you select by clicking on the figure.

于 2013-07-01T19:36:41.420 回答