lims = [...
0 10 1 7
500 578 515 545
0 100 20 75];
nax = size(lims,1);
axlim = lims(:,1:2);
datalim = lims(:,3:4);
axtheta = linspace(0, 2*pi, nax+1);
axtheta = axtheta(end-1:-1:1)';
rdata = nan(size(datalim));
for iax = 1:nax
rdata(iax,:) = interp1(axlim(iax,:), [0 1], datalim(iax,:));
end
xout = rdata(:,2) .* cos(axtheta);
yout = rdata(:,2) .* sin(axtheta);
xout = [xout; xout(1)];
yout = [yout; yout(1)];
xin = rdata(:,1) .* cos(axtheta);
yin = rdata(:,1) .* sin(axtheta);
xin = [xin; xin(1)];
yin = [yin; yin(1)];
lbl1 = arrayfun(@(lo,hi) sprintf('(%d,%d)', lo, hi), axlim(:,1), axlim(:,2), 'uni', 0);
lbl2 = cellstr(num2str((1:nax)', 'Label %d'));
xpoly = [xout; xin(end:-1:1); xout(1)];
ypoly = [yout; yin(end:-1:1); yout(1)];
h.ax = axes('xlim', [-1 1], 'ylim', [-1 1], 'dataaspectratio', [1 1 1], 'visible', 'off');
hold(h.ax, 'on');
h.poly = patch(xpoly, ypoly, 'r');
set(h.poly, 'edgecolor', 'none', 'facealpha', 0.2);
h.outline = plot(xout, yout, 'r', xin, yin, 'r');
h.txt = text([xin(1:end-1); xout(1:end-1)], [yin(1:end-1); yout(1:end-1)], cellstr(num2str(datalim(:))));
h.axline = plot([zeros(1,nax); cos(axtheta')], [zeros(1,nax); sin(axtheta')], '--k');
h.axedge = plot(cos(axtheta([1:end 1])), sin(axtheta([1:end 1])), ':k');
h.axlbl1 = text(cos(axtheta'), sin(axtheta), lbl1, 'fontsize', 8);
h.axlbl2 = text(1.2*cos(axtheta'), 1.2*sin(axtheta'), lbl2, 'horiz', 'center', 'vert', 'top');
isleft = cos(axtheta) < 1;
set(h.axlbl1(isleft), 'horiz', 'right');
Best Answer