Properties of Polaraxes in App Designer not working
5 次查看(过去 30 天)
显示 更早的评论
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 个评论
采纳的回答
Steven Lord
2022-7-19
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."
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Polar Plots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!