フィルターのクリア

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

5 ビュー (過去 30 日間)
Sebastian Roehn
Sebastian Roehn 2016 年 3 月 11 日
回答済み: Sebastian Roehn 2016 年 3 月 22 日
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

回答 (3 件)

Image Analyst
Image Analyst 2016 年 3 月 11 日
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 件のコメント
Sebastian Roehn
Sebastian Roehn 2016 年 3 月 12 日
編集済み: Sebastian Roehn 2016 年 3 月 12 日
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.

サインインしてコメントする。


Sebastian Roehn
Sebastian Roehn 2016 年 3 月 12 日
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 件のコメント
Sebastian Roehn
Sebastian Roehn 2016 年 3 月 16 日
Has no one an idea? Would be great to get an explanation. Maybe I missing something.

サインインしてコメントする。


Sebastian Roehn
Sebastian Roehn 2016 年 3 月 22 日
Seems to be a bug, because it works with R2015b.

カテゴリ

Help Center および File ExchangeInteractive Control and Callbacks についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by