MATLAB: Mouse click callback no longer detects mid and side button mouse clicks in image&plot overlay

guimouse click

I have a simple GUI with 5 subplots; using h(n)=imshow(im), I display 4 grayscales and 1 RGB superimposed with markers using the 'hold on', 'plot', and 'hold off' commands. For each handle I defined a 'ButtonDownFcn' callback. What I am finding is that Matlab does not detect the middle and side mouse buttons in the RGB, but consistently detects the left and right-mouse buttons when clicking on objects in the RGB subplot. However, when I hover over any of the grayscale subplots, all mouse buttons are detected all the time. If I do not plot the markers over the RGB, all mouse buttons are detected, so it seems that updating the markers on the RGB using 'set(ax.h,XData,xvals,YData,yvals)' upsets the applecart.
I've attached a demo (missedmouseclicks.m) to illustrate the issue, and I sure hope that someone can show me the error of my ways.
Many thanks in advance,
Jan

Best Answer

Found the problem and the solution after finding that the problem was actually intermittent. If I clicked ON the marker the MMB would not be detected, but if I clicked NEXT to the marker the MMB would be detected. It appeared that the newly added property PickableParts had to be modified from 'visible' to 'none' in all the plot handles.