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

Hello,
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!
Javi.

 Accepted Answer

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);

6 Comments

That's a shame..
I'll probably follow your recommendation, but please, if you have the power to transmit this, ask Mathworks to include any type of axis inside App Designer. There's no reason to just have cartesian axes and no polar axes, 3D axes, etc...
Thank you!
3D axes are fully supported in App Designer (they are the same as regular axes/UIAxes).
I will make sure your feedback regarding polar axes is captured and transmitted to the team in question.
App Designer doesn't feature polar axes natively? That's a joke, right?
Looks like you are adding the wrong class name to the new PolarAxes property.
Don't use matlab.ui.control.UIAxes, that is specific to cartesian UIAxes.
The class for PolarAxes is matlab.graphics.axis.PolarAxes.
Benjamin,
It is not allowing me to execute
app.PolarAxes = polaraxes(app.Panel);
I get the error
Unrecognized property 'PolarAxes' for class 'moboard'.
Error in moboard (line 118)
runStartupFcn(app, @startupFcn)
(moboard) is the file name for my app moboard.mlapp
What my end goal is is to create a Polar Plot (that things will be plotted on) and have a slider that adjusts the RLim of this plot. My current train of thought was to create the polar plot using your above code then use:
% Value changed function: RadarRange1000sYDSSlider
function RadarRange1000sYDSSliderValueChanged(app, event)
value = app.RadarRange1000sYDSSlider.Value;
PolarAxes.RLim = [0 value];
end
But I keep getting help up by the fact that it doesnt seem to accept app.PolarAxes as valid.
Thanks!
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)

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!

Categories

Tags

Community Treasure Hunt

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

Start Hunting!