Graphics Programs Reference
In-Depth Information
v = [get(cax,'xlim') get(cax,'ylim')];
ticks = sum(get(cax,'ytick')>=0);
delete(hhh);
% check radial limits and ticks
rmin = 0; rmax = v(4); rticks = max(ticks-1,2);
if rticks > 5 % see if we can reduce the number
if rem(rticks,2) == 0
rticks = rticks/2;
elseif rem(rticks,3) == 0
rticks = rticks/3;
end
end
% only do grids if hold is off
if ~hold_state
% define a circle
th = 0:pi/50:2*pi;
xunit = cos(th);
yunit = sin(th);
% now really force points on x/y axes to lie on them exactly
inds = 1:(length(th)-1)/4:length(th);
xunit(inds(2:2:4)) = zeros(2,1);
yunit(inds(1:2:5)) = zeros(3,1);
% plot background if necessary
if ~isstr(get(cax,'color')),
patch('xdata',xunit*rmax,'ydata',yunit*rmax, ...
'edgecolor',tc,'facecolor',get(gca,'color'),...
'handlevisibility','off');
end
% draw radial circles with dB ticks
c82 = cos(82*pi/180);
s82 = sin(82*pi/180);
rinc = (rmax-rmin)/rticks;
tickdB=-10*(rticks-1); % the innermost tick dB value
for i=(rmin+rinc):rinc:rmax
hhh = plot(xunit*i,yunit*i,ls,'color',tc,'linewidth',1,...
'handlevisibility','off');
text((i+rinc/20)*c82*0,-(i+rinc/20)*s82, ...
[' ' num2str(tickdB) ' dB'],'verticalalignment','bottom',...
'handlevisibility','off')
tickdB=tickdB+10;
end
set(hhh,'linestyle','-') % Make outer circle solid
% plot spokes
th = (1:6)*2*pi/12;
Search WWH ::




Custom Search