Azzera filtri
Azzera filtri

Properties of Polaraxes in App Designer not working

3 visualizzazioni (ultimi 30 giorni)
Hello.
In the app I'm currently working on I have Tabs, and in one of these Tabs there is a Grid and inside this Grid there is supposed to be a polarplot (polarbubblechart to be specific). I defined myself some Polaraxes via
pax = polaraxes('Parent', app.GridLayout8, 'ThetaZeroLocation', 'bottom');
In those I then plot the polarbubblechart. This works alright, but the properties of the polaraxes, whether I define them as above or manually after the fact, like
pax.ThetaZeroLocation = 'bottom';
nothing happens. I tried different properties as well.
What is going on here? Why doesn't the plot react?
Thanks in advance.

Risposta accettata

Steven Lord
Steven Lord il 19 Lug 2022
As a high-level plotting function, by default polarbubblechart will reset most of the properties of the polaraxes to their defaults before plotting. This is described on the documentation pages for the hold and newplot functions. Using some sample data from the polarbubblechart documentation page:
Without HOLD
pax = polaraxes('ThetaZeroLocation', 'bottom');
pax.ThetaZeroLocation
ans = 'bottom'
th = linspace(0,2*pi,10);
r = rand(1,10);
sz = rand(1,10);
polarbubblechart(th,r,sz);
pax.ThetaZeroLocation
ans = 'right'
If you tell MATLAB to hold on (or manually set the polaraxes property NextPlot to 'add' or 'replacechildren') then polarbubblechart won't reset the properties.
With HOLD
figure
pax = polaraxes('ThetaZeroLocation', 'bottom');
pax.ThetaZeroLocation
ans = 'bottom'
pax.NextPlot % See the newplot documentation page for an explanation of 'replace'
ans = 'replace'
hold on
pax.NextPlot % and an explanation of 'add'
ans = 'add'
th = linspace(0,2*pi,10);
r = rand(1,10);
sz = rand(1,10);
polarbubblechart(th,r,sz);
pax.ThetaZeroLocation
ans = 'bottom'
Since the NextPlot property value was 'add' when I called polarbubblechart MATLAB will "not delete existing plots or reset axes properties before displaying the new plot."

Più risposte (0)

Categorie

Scopri di più su Polar Plots in Help Center e File Exchange

Tag

Community Treasure Hunt

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

Start Hunting!

Translated by