MATLAB Answers

Axes Toolbar customization in App Designer

53 views (last 30 days)
Matt on 23 Apr 2020
Commented: Stefan on 26 Oct 2020
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:
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?


Show 1 older comment
Matt on 11 Jun 2020
I was never able to make this work. It looks like MATLAB 2020a has the ability to do what I described, per Payas’s comment, but I personally do not have access to that version yet.
Ajeya Gupta
Ajeya Gupta on 14 Oct 2020
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.
Matt on 21 Oct 2020
I never found a solution and have not had time to revisit the issue. Check the answer provided by Payas below. It sounded like at least some of what I was looking for may be available in R2020a, but while I now have access to R2020a, I have not had an opportunity to install and use it for any task.

Sign in to comment.

Answers (1)

Payas Bahade
Payas Bahade on 29 Apr 2020
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!

  1 Comment

Stefan on 26 Oct 2020
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:
But the datacursor is left out (2020b)

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!