![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/349934/image.jpeg)
How can I set an axis outside the polar figure
3 次查看(过去 30 天)
显示 更早的评论
How can i set the pola axis outside the figure and to set it to be starting from 70 not zero
the original figue is shown below
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/349919/image.jpeg)
I have used the following matlab code mentioned (https://www.mathworks.com/matlabcentral/answers/518832-how-can-i-set-an-axis-outside-the-polar-figure-like-this-photo?fbclid=IwAR1wv7SMdBdUkPmGRIYmzt_n9a8GOinZ1wyPHpxx4eAINHjF1DLoRu25Ofc)
figure(2)
set(gcf,'color','w');
ax = polaraxes('Position', [0.25 0.25 0.6 0.6])
polarplot (theta,splbn(21,:));
ax.ThetaDir = 'counterclockwise';
ax.ThetaZeroLocation = 'left';
rlim([70,120])
ax.RTickLabel = [];
ticks = [-flip(ax.RTick(2:end)) ax.RTick];
a = axes('Color', 'none',...
'XColor', 'none',...
'Position', ax.Position,...
'YLim', [-ax.RLim(2) ax.RLim(2)],...
'YTick', ticks,...
'YTickLabel', abs(ticks));
ylabel(a, 'r axis label')
the ouput of the code is shown below
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/349922/image.jpeg)
how i can modify the axis to be sarting from 70 min of (rlim) not zero ?
0 个评论
采纳的回答
jonas
2020-8-22
编辑:jonas
2020-8-22
I've modified your code. Not sure how robust this solution is, but you can try this:
figure(2)
set(gcf,'color','w');
ax = polaraxes('Position', [0.25 0.25 0.6 0.6])
ax.ThetaDir = 'counterclockwise';
ax.ThetaZeroLocation = 'left';
rlim([70,120])
ax.RTickLabel = [];
ticks = [-flip(ax.RTick(2:end)) ax.RTick];
a = axes('Color', 'none',...
'XColor', 'none',...
'Position', [ax.Position(1),ax.Position(2)+ax.Position(4)/2,...
ax.Position(3),ax.Position(4)/2],...
'YLim', [ax.RLim(1) ax.RLim(2)],...
'YTick', ticks,...
'YTickLabel', abs(ticks));
a_m = copyobj(a,gcf)
a_m.Position = a.Position - [0 a.Position(4),0,0];
a_m.YAxis.Direction = 'reverse';
ylabel(a, 'r axis label')
a.YAxis.Label.Position = [a.YAxis.Label.Position(1),70,0];
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/349934/image.jpeg)
4 个评论
jonas
2020-8-27
Just set the RTick after line 6 in the above code. Use whatever ticks you want
...
rlim([70,130])
ax.RTick = [80 100 130]
ax.RTickLabel = [];
...
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Polar Plots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!