Skip to Main Content Skip to Search
Login
File Exchange
MATLAB Newsgroup
Link Exchange
  Blogs  
 Contest 
MathWorks.com

Thread Subject: Polar plot with dB scale

Subject: Polar plot with dB scale

From: Jennifer Cohen

Date: 6 Aug, 2007 13:10:28

Message: 1 of 10

I am trying to plot radiation patterns for antennas on a
polar plot. Any ideas how I can convert the rho axis to a
log scale? Im using version 6.5

Subject: Polar plot with dB scale

From: Chi Zhang

Date: 29 Oct, 2007 23:45:13

Message: 2 of 10

I want to know the answer as well, anyone can help?

Subject: Polar plot with dB scale

From: Chi Zhang

Date: 29 Oct, 2007 23:49:37

Message: 3 of 10

I want to know the answer too, anyone help please?

Subject: Polar plot with dB scale

From: roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson)

Date: 30 Oct, 2007 00:03:48

Message: 4 of 10

In article <f976k4$j8k$1@fred.mathworks.com>,
Jennifer Cohen <j_co50@hotmail.com> wrote:
>I am trying to plot radiation patterns for antennas on a
>polar plot. Any ideas how I can convert the rho axis to a
>log scale? Im using version 6.5

You can't. If you did, then your plot would have to become infinitely
large in order to accomedate the polar pole which is always
at radius 0 (log of which is negative infinity.)
--
  "There are some ideas so wrong that only a very intelligent person
  could believe in them." -- George Orwell

Subject: Polar plot with dB scale

From: Chi Zhang

Date: 30 Oct, 2007 00:12:08

Message: 5 of 10

Hi Roberson, thank you for replying so quickly! 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!!!

Subject: Polar plot with dB scale

From: roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson)

Date: 30 Oct, 2007 03:09:11

Message: 6 of 10

In article <fg5sso$se2$1@fred.mathworks.com>,
Chi Zhang <ela04cz@gmail.com> wrote:
>Hi Roberson, thank you for replying so quickly!

'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

Subject: Polar plot with dB scale

From: Chi Zhang

Date: 2 Nov, 2007 17:39:38

Message: 7 of 10

Hi,thank you so much for helping. I tried the code you
suggested, instead of giving flower petals like radiation
pattern, it gave me some spirals...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?

Subject: Polar plot with dB scale

From: roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson)

Date: 2 Nov, 2007 20:47:17

Message: 8 of 10

In article <fgfncq$pni$1@fred.mathworks.com>,
Chi Zhang <ela04cz@gmail.com> wrote:
>Hi,thank you so much for helping. I tried the code you
>suggested, instead of giving flower petals like radiation
>pattern, it gave me some spirals...

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

Subject: Polar plot with dB scale

From: Markus Buehren

Date: 2 Nov, 2007 22:38:28

Message: 9 of 10

Use mmpolar from the file exchange!

Markus

Subject: Polar plot with dB scale

From: zarreen

Date: 19 Jun, 2008 10:39:02

Message: 10 of 10

"Jennifer Cohen" <j_co50@hotmail.com> wrote in message
<f976k4$j8k$1@fred.mathworks.com>...
> I am trying to plot radiation patterns for antennas on a
> polar plot. Any ideas how I can convert the rho axis to
a
> log scale? Im using version 6.5

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Tag Activity for This Thread
Tag Applied By Date/Time
polar log db Jonas Hansen 11 Sep, 2008 06:14:59
polar log db Chi Zhang 29 Oct, 2007 20:13:50
log scale Jennifer Cohen 7 Aug, 2007 06:22:12
polar plot Jennifer Cohen 7 Aug, 2007 06:22:12
rssFeed for this Thread

envelope graphic E-mail this page to a colleague

Public Submission Policy
NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Disclaimer prior to use.
Related Topics