'Roberson' is my family name; my given name is 'Walter'.
>I think I
>didn't state the problem clearly: it is the axis I want to
>change, not the plot itself. Actually I want my plot's rho
>scale to be (from out-side most circle in) 0dB, 10dB,
>20dB,and 30dB, instead of the linear scale (from inside out)
>0, 2, 4, 6, 8, 10. Thanks a lot for anyone helps, really
>really appreciate it!!!
polar(1:10,1:10);
set(findobj(gca, 'String', ' 10'),'String', '0 dB');
set(findobj(gca, 'String', ' 8'),'String', '10 dB');
set(findobj(gca, 'String', ' 6'),'String', '20 dB');
set(findobj(gca, 'String', ' 4'),'String', '30 dB');
set(findobj(gca, 'String', ' 2'),'String', '40 dB');
To automate this more, you can find out what the strings
are that you need to replace:
yticks = get(gca,'YTick');
yticklabs = get(gca,'YTickLabel');
activelabs = cellstr(yticklabs(yticks>0,:));
numlabs = length(activelabs);
for K=1:numlabs
set(findobj(gca, 'String', [' ' activelabs{K}]), ...
'String', num2str(10*(numlabs-K),'%d dB'));
end
I don't promise that the pattern will always be two spaces followed
by the tick label; that was the pattern in the tests I did.
--
"No one has the right to destroy another person's belief by
demanding empirical evidence." -- Ann Landers
You said, "I want the axis to change, not the plot itself".
So the code doesn't change the plot, just how the plot is labelled.
If you are getting spirals and you want flower petals, then it
is likely that you need a log() taken at some point. So use the
code I provided and pass in the log() of your current rho data.
>I think it might just be
>a small trick, as all I want to do is to change the linear
>polar plot into semi log polar plot, just as people can
>change x(linear)-y(linear)plot into x(linear)-y(log)plot, by
>typing 'semilog'.I have checked website and help doc I got,
>no answer found. Any ideas?
No, it isn't just "a small trick". Matlab does not support
semi-log plots; as I pointed out in another posting in this thread,
doing so would require an infinite plot because of the infinity
of log(x) where x is 0 to 1. The best you can do is trick polar()
to relabel the concentric circles.
Within the last few days I have been in contact with Mathworks support
on the issue of using log() and polar() [I found a some bugs in the polar
plotting routines], and the official word from them is that there is
no support for log polar plots.
--
"All is vanity." -- Ecclesiastes
Markus
polar(theta,40-10*log10(x))
Your polar plot will then have values between 0 and 40. You can then manually change the value of 40 to 10dB (edit plot, double click in the 0 value)