How to add a secondary axis to a polarplot on matlab?

1 回表示 (過去 30 日間)
Abraham Hartley
Abraham Hartley 2019 年 10 月 26 日
回答済み: Star Strider 2019 年 10 月 26 日
how would one add a seconday radial axis to a polar plot with its own unique limits?

回答 (1 件)

Star Strider
Star Strider 2019 年 10 月 26 日
Try this:
t = 0 : 2*pi/177 : 2*pi;
a=linspace(0.3,0.5,178);
m=linspace(0.4,0.6,178);
figure(3)
ax = polaraxes;
hold on
polarplot(ax,t,a,'-b')
polarplot(ax,t,m,'-r')
ax.RColor ='blue';
ax.ThetaDir = 'counterclockwise';
ax.ThetaZeroLocation = 'bottom';
thetaticks([0:30:360])
thetaticklabels({'180','150','120','90','60','30','0','330','300','270','240','210'})
rlbl = sprintfc('%.0f',(0:2:6)); % Radius Labels
text(ones(1,4)*1.8*pi, (0:2:6)*0.1, rlbl, 'Color','r') % Label Radii
addgrid = [0.1; 0.3; 0.5]*ones(size(t)); % Calculate Grid Lines At [0.1 0.3 0.5]
polarplot(ax, t, addgrid, '--k') % Plot Them
Experiment to get the result you want.

カテゴリ

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