Polarplot, how to delete outmost circle (axis) and message

3 ビュー (過去 30 日間)
Dingodongo
Dingodongo 2023 年 12 月 26 日
コメント済み: Star Strider 2023 年 12 月 26 日
Hi,
I am trying to make a polarpattern of a phased array antenna, how can I get rid of the outmost circle in the plot, see the picture below. So I just want to see the circles at the magnitudes I set in the code (P.MagnitudeTick=[0.2 0.4 0.6 0.8 1]), the last circle should be the one with "1", no circle after that should be seen.
Also, is there a way to hide the message "Right click to interact with the plot", because it also appears in the svg-exports that I make, if I do not click it away beforehand (and I have hundrets of plots to make, it is very annoying to click all of them away).
Thank you very much!!

採用された回答

Star Strider
Star Strider 2023 年 12 月 26 日
The extra circle outside the magnitude 1 circle is the result of specifying this:
P.MagnitudeLim=[0 1.05];
If you remove that (or comment it out as I did here, or set it equal to 1 rather than 1.05), the extra circle disappears.
Try this —
clear all
%close all
clc
%╭────────────────────────────╮
steeringangle= 30 *-1;
firstplot=0;
%╰────────────────────────────╯
if (firstplot)
figure
else
hold on
end
% %%
% Create a Uniform Linear Array Object
Array = phased.ULA('NumElements',8,...
'ArrayAxis','y');
% The multiplication factor for lambda units to meter conversion
Array.ElementSpacing = 0.4999*1;
Array.Taper = ones(1,8).';
% Create an short dipole antenna element
Elem = phased.ShortDipoleAntennaElement;
Elem.FrequencyRange = [0 300000000];
Elem.AxisDirection = 'z';
Array.Element = Elem;
% Assign Frequencies and Propagation Speed
Frequency = 300000000;
PropagationSpeed = 300000000;
% Assign Steering Angles
SteeringAngles = [steeringangle;0];
% Assign Phase shift quantization bits
PhaseShiftBits = 0;
% Calculate Steering Weights
Freq3D = 300000000;
% Find the weights
w = zeros(getNumElements(Array), length(Frequency));
SteerVector = phased.SteeringVector('SensorArray', Array,...
'PropagationSpeed', PropagationSpeed, 'NumPhaseShifterBits', PhaseShiftBits(1));
for idx = 1:length(Frequency)
w(:, idx) = step(SteerVector, Frequency(idx), SteeringAngles(:, idx));
end
% % ╭────────────────────────╮
% %% │ 2D Polar Pattern │
% % ╰────────────────────────╯
format = 'polar';
cutAngle = 0;
plotType = 'Directivity';
plotStyle = 'Overlay';
p=1.03*pattern(Array, Frequency, -180:180, cutAngle, 'PropagationSpeed', PropagationSpeed,...
'CoordinateSystem', format ,'weights', w, ...
'Type', plotType, 'PlotStyle', plotStyle);
p_mag=normalize(db2mag(p),"range");
figure
P = polarpattern(0:1:360,p_mag);
P.LineWidth = 2;
P.AngleResolution= 45;
P.FontSizeMode= 'manual';
P.FontSize= 18;
P.FontName='Times';
P.AngleLim= [0 360];
P.AngleTickLabel = string(P.AngleTickLabel) + char(176) +' ';
P.MagnitudeFontSizeMultiplier=1;
P.MagnitudeAxisAngle= 315;
P.MagnitudeTick=[0.2 0.4 0.6 0.8 1];
% P.MagnitudeLim=[0 1.05]; % <— CHANGED
%Hintergrund auf weiß
P.GridBackgroundColor=[ 1 1 1];
print('Antenna','-dpng')
Warning: In a future release, UI components will not be included in the output. To include UI components, use the exportapp function.
imshow(imread('Antenna.png'))
.
  2 件のコメント
Dingodongo
Dingodongo 2023 年 12 月 26 日
thank you very much I also found another solution that keeps "1" centered:
c=findall(gcf,'Tag','PolarGrid1');
delete(c(3));
range=712-181:712;
c(2).XData(range)=0;
c(2).YData(range)=0;
The message popup is not a problem if i keep the mouse away from the figure it does not appear, so I think this is solved
Star Strider
Star Strider 2023 年 12 月 26 日
My pleasure!
The message only appears in the GUI. It does not appear in the actual plot, or the plot image.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeArray Geometries and Analysis についてさらに検索

製品


リリース

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by