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

22 vues (au cours des 30 derniers jours)
Javi García
Javi García le 27 Avr 2020
Commenté : Benjamin Kraus le 8 Juin 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.

Réponse acceptée

Benjamin Kraus
Benjamin Kraus le 29 Avr 2020
Modifié(e) : Benjamin Kraus le 29 Avr 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);
  6 commentaires
Charlie Wannall
Charlie Wannall le 7 Juin 2020
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!
Benjamin Kraus
Benjamin Kraus le 8 Juin 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.

Connectez-vous pour commenter.

Plus de réponses (2)

Javi García
Javi García le 6 Mai 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 le 6 Mai 2020

Catégories

En savoir plus sur Polar Plots dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by