Axes Toolbar customization in App Designer
43 次查看(过去 30 天)
显示 更早的评论
The Axes Toolbar of a uiaxes object created in App Designer appears by default with the following buttons: Export, Pan, Zoom In, Zoom Out, Restore View. Is there any way to provide the default functionality you get from the Axes Toolbar created when you call the plot function from an m-file or the command line? I want to provide the Brush and Data Cursor buttons and the functionality you get when right-clicking in the axes object after selecting a button from the toolbar (Export Cursor Data to Workspace, Horizontal/Vertical/Unconstrained Pan and Zoom, etc.). I do realize you can zoom in horizontally and vertically in the uiaxes object by dragging the cursor in a straight line. Double-clicking in the axes object normally restores the view, but that functionality also seems to be missing.
I attempted to create my own toolbar with the axtoolbar command as follows:
app.UIAxes.axtoolbar({'export','brush','datacursor','pan','zoomin','zoomout','restoreview'});
The axtoolbar property does not appear to be useable within App Designer. Is this the case? If so, is there any way to provide the standard Axes Toolbar functionality I described in App Designer?
Thanks.
4 个评论
Ajeya Gupta
2020-10-14
Hi Matt,
Did you arrive at a solution to this problem? I am looking to modify the appearance of Axes toolbar on Matlab's Appdesigner. I am currently using Matlab 2020a version. The only function that works with app.UIAxes is 'Visible'. I am not able to modify the contents of toolbar on top right.
Thanks,
Ajeya
回答(2 个)
Payas Bahade
2020-4-29
Hi Matt,
Starting from MATLAB R2020a, axes toolbar of UIAxes in App Designer supports functionalities like persistent data tips, brushing data points and ‘export to workspace’ option in context menu. For more details, please refer ‘App Building’ section in release notes of R2020a.
Hope this helps!
2 个评论
Stefan
2020-10-26
Is there a way to use the classical Data Tip Tool in a UI Axes? (Datacursor as mentioned in the toolbar doc?)
I'm trying:
axtoolbar(app.UIAxes,{'export','datacursor','zoomin','zoomout','restoreview'});
But the datacursor is left out (2020b)
Tim Felix Liesching
2021-1-21
编辑:Tim Felix Liesching
2021-1-21
Same problem here. Data cursor is left out. Did anyone solve the issue?
Lior de Marcas
2023-8-27
编辑:Lior de Marcas
2023-8-27
This might be solved as of 2023a, at least in MATLAB online it seem like it.
For older version:
As a workaround I just made my own "custom" data-tips button.
The custom button is showing, and seems to behave alright: (tested 2022a):
% open empty figure & plot something
f = uifigure();
ax = uiaxes(f);
plot(ax,1:10)
% collect the axtoolbar, and add custom button
tb = axtoolbar(ax,"default");
axtoolbarbtn(tb,"state","Icon","datacursor","Tooltip","Data Tips",...
"ValueChangedFcn",@(e,d)datacursormode(ancestor(d.Source,'figure'),d.Value))
% the ValueChangedFcn is taken from the original button, as-is.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Interaction Control 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!