Warning in hold and legend commands in appdesigner

2 ビュー (過去 30 日間)
Anum Ahmed Pirkani
Anum Ahmed Pirkani 2021 年 1 月 27 日
コメント済み: Anum Ahmed Pirkani 2021 年 1 月 29 日
Hello,
Since a few days, I am getting a warning saying 'Specify a UIAxes Handle as first argument' on certain commands associated with the plot functions in appdesigner. These warnings did not appear a couple of months ago, I am just wondering is it due to any update? I am currently using Matlab2020b version.
An example is given below for polar plot. I am getting the same warnings on lines 3,5 and 6.
app.pax = polaraxes(app.Ant_Pat); % Creates polar axes inside the panel
polarplot(app.pax,deg2rad(app.Azimuth_V(600:3000)),pow2db(app.G_ta_v(1800,600:3000)),'g','LineWidth',2);
hold(app.pax,'on'); %getting warning
polarplot(app.pax,deg2rad(app.Azimuth_V),pow2db(app.G_ra_v(1800,:)),'r','LineWidth',2);
legend(app.pax,{'Transmit Antenna','Receive Antenna'},'Location','south'); %getting warning
legend(app.pax,'boxoff') %getting warning
Is there any replacement command in order to avoid these warnings?
Kind Regards
Anum
  2 件のコメント
Walter Roberson
Walter Roberson 2021 年 1 月 28 日
As an experiment, try
app.pax = polaraxes(app.Ant_Pat); % Creates polar axes inside the panel
class(app.pax)
isgraphics(app.pax)
polarplot(app.pax,deg2rad(app.Azimuth_V(600:3000)),pow2db(app.G_ta_v(1800,600:3000)),'g','LineWidth',2);
isgraphics(app.pax)
class(app.pax)
I am just wondering if the polarplot() is somehow deleting or changing the axes
Anum Ahmed Pirkani
Anum Ahmed Pirkani 2021 年 1 月 29 日
Its still the axis before and after the polar plot. 'matlab.graphics.axis.PolarAxes'
The warning is hidden after enabling app coding alerts tough.

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

回答 (1 件)

Mario Malic
Mario Malic 2021 年 1 月 28 日
I think this happens when you use UIFigure or regular Figure that doesn't exist as the Component in the app. What is app.Ant_Pat? See this question, if you specify Panel as the parent of the polarplot, you might not get the warning.
  2 件のコメント
Anum Ahmed Pirkani
Anum Ahmed Pirkani 2021 年 1 月 29 日
Thanks, let me check
Anum Ahmed Pirkani
Anum Ahmed Pirkani 2021 年 1 月 29 日
app.Ant_Pat was actually the panel as suggested in the post...

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

カテゴリ

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

製品


リリース

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by