"scho " <email@example.com> wrote in message <firstname.lastname@example.org>... > "Steven_Lord" <email@example.com> wrote in message <firstname.lastname@example.org>... > > > > > > "Sanghee " <email@example.com> wrote in message > > news:firstname.lastname@example.org... > > > Right now, I am learning MATLAB GUI using GUIDE, and getting a lot of help > > > from the examples on the mathworks. > > > > > > While trying an example, in > > > /usr/local/matlab/R2009b/help/techdoc/creating_guis/examples/tablestat.fig > > > > > > I found some weird thing. Basically, it will allow user to plot a figure > > > (a graph in > > > the example) in an axes to a standalone new figure window when user clicks > > > the axes with mouse right button and select 'Open plot in new window'. > > > But, I noticed that I have 'Open plot in new window' only when I click in > > > the empty > > > space in the plot, and don't have 'Open plot in new window' message box > > > when > > > I click the drawn line in the figure. > > > > That's correct; more than likely that example uses the axes ButtonDownFcn > > property, which does not trigger if the user doesn't click on the axes > > itself. The _line's_ ButtonDownFcn property would trigger if you clicked on > > the line. > > > > http://www.mathworks.com/help/techdoc/ref/axes_props.html#ButtonDownFcn > > > > "Executes whenever you press a mouse button while the pointer is within the > > axes, but not over another graphics object parented to the axes." > > > > > So, I never get to have the 'Open plot in new window', when I completely > > > fill in the axes with an image since I think the program does not > > > recognize the axes ? > > > > That's correct -- you aren't clicking on the _axes_, you're clicking on the > > _image_. > > > > > However, again, I get it when I click the empty axes before filling the > > > axes with an image. > > > > > > Can anyone suggest any solution for this ? > > > > Change the value of the HitTest property for those objects that you don't > > want to "count" as being clicked upon. > > > > http://www.mathworks.com/help/techdoc/ref/image_props.html#HitTest > > > > -- > > Steve Lord > > email@example.com > > comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ > > To contact Technical Support use the Contact Us link on > > http://www.mathworks.com > Thanks for the quick reply. I think 'HitTest' could be an option, but I am not sure how > I can handle it in my case. > > My case is simple. I have a 2D image array, let's say xx, which is 256x256 matrix, > and all I do do display it in axes1 in a callback function triggered by a button, > > axes(handles.axes1); > imagesc(xx);axis equal off > > That's it, but I am wondering how I can apply your suggestion into here. > > --
I just also tried, with like this,
h = imagesc(xx);axis equal off set(h,'HitTest','off');
Was this what you meant ? Then, I just observed that this does not work.