Polar plot in App Designer (Edit: Not possible April 2020)

74 views (last 30 days)
I have an app created with App Designer with regular cartesian axes in the UIFigure, some buttons and values, and I just want to add a polar axis underneath the cartesian ones. I've been searching information and the only thing I could find is to create the polar axis inside de UIFigure, but that's just plots the polar axis behind every component of the app, so it's useless.
To sum up, I just want to know if there's an option where I can change the default cartesian UIAxes to a polar axes, the ones you create with 'polaraxes' and 'polarplot'.
Thank you!

Accepted Answer

Benjamin Kraus
Benjamin Kraus on 29 Apr 2020
Edited: Benjamin Kraus on 29 Apr 2020
At the moment the only way to use a polar axes within App Designer is to call the polaraxes command from within your code (such as the startup function).
My personal recommendation is to put a panel into your app where you want the polar axes to be located. Then, create a property on your app to store the polar axes handle. Within your code you call the polaraxes command with the panel as the first input, and the polar axes will fill the panel.
app.PolarAxes = polaraxes(app.Panel);
Benjamin Kraus
Benjamin Kraus on 8 Jun 2020
The PolarAxes property does not exist on the app unless you create it. The name PolarAxes is not special as a property name, you can name the property anything you want.
Properties are automatically created for components (like Cartesian axes) that you create in design view, but if you want to create your own properties you can follow the instructions on this documentation page: Share Data Within App Designer Apps.

Sign in to comment.

More Answers (2)

Javi García
Javi García on 6 May 2020
If this is useful for anyone, I followed Benjamin's recommendation by doing this:
% Inside startupFcn (app)
app.pax = polaraxes(app.Panel); % Creates polar axes inside the panel
% Inside my plotting function
polarplot(app.pax,deg2rad(theta),rho); % Plots in the polar axes variable 'app.pax'
Hope this helps anyone who find this thread!

John Scoggin
John Scoggin on 6 May 2020


Community Treasure Hunt

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

Start Hunting!

Translated by