labeling points in a plot in GUI

Hi,
I am trying to label the points in a plot. I can do this in a normal figure but not inside a gui axes. I used debugger to see whats going on, but its plotting on the next axes which gets invisible because another image gets plotted over there. Here's the part of the code: * imagesc(d1(:,:,z,t1)), colormap gray;
hold on
axes(handles.axes1);
plot(y_val, x_val, 'r*');
strValues = strtrim(cellstr(num2str([x_val(:) y_val(:)],'(%d,%d)')));
text(double(x_val),double(y_val),strValues,'VerticalAlignment','bottom');
hold off *
any help would be appreciated.

댓글 수: 1

Jan
Jan 2011년 6월 27일
You can use the "{} Code" button above the edit field to format your code.

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

답변 (1개)

Jan
Jan 2011년 6월 27일

1 개 추천

Is "handles.axes1" the axes you want to write to? Then:
text(double(x_val), double(y_val), ...
strValues, 'VerticalAlignment', 'bottom', ...
'Parent', handles.axes1);
If you want another axes, use the corresponding handle as Parent.

댓글 수: 1

Nripesh
Nripesh 2011년 6월 27일
hi Jan..
Thanks for the response.
that is the axes i'm trying to write to. I tried your idea but it didn't work.
Basically what i'm trying to do is mark these points in a plot and have a table on the side that corresponds to them. If all the points are the same then the table will make no sense.
Do you have any suggestions?

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

카테고리

도움말 센터File Exchange에서 Creating, Deleting, and Querying Graphics Objects에 대해 자세히 알아보기

질문:

2011년 6월 27일

Community Treasure Hunt

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

Start Hunting!

Translated by