|
function hc <br>% made by genial in simwe<br>ezplot('sin(x)'); <br>set(gcf,'pointer','cross'); <br>set(gcf,'WindowButtonMotionFcn',@tempfcn2); <br> <br>function tempfcn2(hObject, eventdata, handles) <br>p=get(gca,'currentpoint'); <br>if(isempty(findobj('tag','htext'))) <br> ht=text('tag','htext','string',sprintf('(%g, %g)', p(1), p(3)),'position',[p(1),p(3)]); <br>else <br> ht = findobj('tag','htext'); <br> set(ht,'string',sprintf('(%g, %g)', p(1), p(3)),'position',[p(1),p(3)]); <br>end <br>==============================================<br>看错了...-_-|||<br>直接用get(handles.youraxes,'XDATA')<br>OR<br>get(handles.youraxes,'YDATA')<br>如果是某条曲线上的点,用findobj找到句柄再用上面的语句,细节自己搞吧,应该很简单,前提是图为你自己画的,或者是fig格式的,别的什么jpg之类的应该不行。<br>
[此贴子已经被作者于2006-6-8 0:37:39编辑过]
|
|