フィルターのクリア

Properties of Polaraxes in App Designer not working

3 ビュー (過去 30 日間)
Adrian
Adrian 2022 年 7 月 19 日
コメント済み: Adrian 2022 年 7 月 19 日
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.

採用された回答

Steven Lord
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
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."
  1 件のコメント
Adrian
Adrian 2022 年 7 月 19 日
Thank you, this is what I needed.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangePolar Plots についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by