Properties of Polaraxes in App Designer not working
5 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Adrian
am 19 Jul. 2022
Kommentiert: Adrian
am 19 Jul. 2022
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.
0 Kommentare
Akzeptierte Antwort
Steven Lord
am 19 Jul. 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
th = linspace(0,2*pi,10);
r = rand(1,10);
sz = rand(1,10);
polarbubblechart(th,r,sz);
pax.ThetaZeroLocation
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
pax.NextPlot % See the newplot documentation page for an explanation of 'replace'
hold on
pax.NextPlot % and an explanation of 'add'
th = linspace(0,2*pi,10);
r = rand(1,10);
sz = rand(1,10);
polarbubblechart(th,r,sz);
pax.ThetaZeroLocation
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."
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Polar Plots finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!