Effacer les filtres
Effacer les filtres

axes hittest and pickableparts properties ignored if axes parent is a figure

5 vues (au cours des 30 derniers jours)
Sebastian Roehn
Sebastian Roehn le 11 Mar 2016
Hello, I'm working on function for zoom orientation. The Fcn changes width and height of an existing axes and adds two new axes, xOrientation and yOrientation plus xSlider and ySlider. Zoom should be possible only on the main axes, not the small orientation axes. Therefor I set the hittest and pickableparts properties to off/none.
% create x axes orientation window
handles.xWin = axes('Units','normalized',...
'Parent',handles.axhParent,...
'Position',xWinPos,...
'Color',BgColor,...
'XColor',xtickColor,...
'YColor','none',...
'NextPlot','add',...
'ClippingStyle','rectangle',...
'Box','off',...
'HitTest','off',...
'PickableParts','none',...
'XScale',xscale,...
'FontSize',7,...
'Tag','xWin');
If handles.axhParent is a uitab, like in the screenshot, hittest and pickableparts properties of those two new axes are accepted. You cannot zoom in those axes. But if handles.axhParent is a figure, the properties are ignored and you can zoom in or out in those axes. Why is that? Thank you for your help! Best regards

Réponses (3)

Image Analyst
Image Analyst le 11 Mar 2016
Regardless of which axes, how is the user telling your app that he wants to zoom in on the data? Exactly what do the scrollbars do? Control the width of the zoomed window? How are you setting the location? Why don't you have two scrollbars, one for the left index (or bottom ylim value), and one for the right index (or top ylim value)?
  1 commentaire
Sebastian Roehn
Sebastian Roehn le 12 Mar 2016
Modifié(e) : Sebastian Roehn le 12 Mar 2016
The black rectangles in the small axes show the zoom area of the main axes compared to the full view. Do you mean by scrollbars = sliders? The slider moves the rectangle left/right or up/down and changes thereby the axis limits in the main axes. The function has callbacks to detect user mouse actions like zoom in/out. But imho that isn't really important for the question.
As you can see on the screenshot, zoom is on (Button magnifier+ on toolbar ). So if you move the mouse over the axes, the mouse pointer changes to the magnifier+ icon. But this icon should be visible only over the main axes, not on the other two small axes. Therefore I set the properties hittest and pickableparts of those small axes to off/none. If the main axes parent is a uitab, it works like it should. But not with a figure. A screenshots doesn't cover the actual mouse icon.

Connectez-vous pour commenter.


Sebastian Roehn
Sebastian Roehn le 12 Mar 2016
Is the parent object of the axes a uipanel, will be the properties hittest and pickableparts also ignored like with a parent figure. When I check the objects properties in the workspace, they are set correctly. I cannot find a hint at the help pages, why a uitab use the settings but figure and uipanel not.
  1 commentaire
Sebastian Roehn
Sebastian Roehn le 16 Mar 2016
Has no one an idea? Would be great to get an explanation. Maybe I missing something.

Connectez-vous pour commenter.


Sebastian Roehn
Sebastian Roehn le 22 Mar 2016
Seems to be a bug, because it works with R2015b.

Catégories

En savoir plus sur Interactive Control and Callbacks dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by