필터 지우기
필터 지우기

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."

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Polar Plots에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by