Code covered by the BSD License  

Highlights from
Advanced Polar Plots v2

5.0

5.0 | 2 ratings Rate this file 55 Downloads (last 30 days) File Size: 14.9 KB File ID: #22859

Advanced Polar Plots v2

by Daniel Armyr

 

02 Feb 2009 (Updated 24 Mar 2009)

An improved version of the MATLAB function 'polar'.

| Watch this File

File Information
Description

 An improved version of the MATLAB function 'polar'. Supports negative numbers and other plotting features. David Ireland's original completed with Dr. Thomas Patzelt's bugfix.

Acknowledgements

The author wishes to acknowledge the following in the creation of this submission:
Advanced Polar Plots
This submission has inspired the following:
Polar 2

MATLAB release MATLAB 7.7 (R2008b)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (18)
10 Feb 2009 tstmwind

Are you able to specify the axis handle for this function as you can for polar.m? EX: polar(axish,theta,rho)

11 Feb 2009 Daniel Armyr

Unfortunately not. The function will plot into the entire current figure, overwriting all its settings with a "clf reset" before starting.

23 Mar 2009 Vincent Blandeau

I am using Matlab R2008b and the routine was bugging because the variables PlotStartFlag and PlotBreakFlag were defined as "char" on lines 1027-1028, instead of arrays.

The bug was fixed by modifying lines 1027-1028 as :

PlotStartFlag = [ ];
PlotBreakFlag = [ ];

Thank you by the way for this very nice function :-)

24 Mar 2009 Daniel Armyr

OK, new version uploaded for review with Vincents fix and a fix for the missing return argument bug.

31 Mar 2009 Noelia Oses

Hi Daniel,

Thanks a lot for this!!
I came across your function looking for how to make a polar plot look like a compass from 0 to 360 deg clock wise
and that the center to 0 axis is vertical pointing up.

Now I get what I wanted but unfortunately I get some error messages and pp.m doesn't plot my data.

Any help you might provide is very much appreciated.

The error messages are the following:

??? For colon operator with char operands, first and last operands must be char.

Error in ==> pp>PlotTrace at 1262
        x = norm_r(PlotStartFlag(i):PlotBreakFlag(i)).*cos(theta(PlotStartFlag(i):PlotBreakFlag(i)));

Error in ==> pp at 287
    PlotTrace(ThetaPlot, RPlot, PlotProperties, Traces{i+1});

Error in ==> PlotGaitData at 23
    pp(theta,rho,'-or','ThetaDirection','cw','ThetaStartAngle',270,'CentreValue',0)

Thanks,
Noelia

31 Mar 2009 Noelia Oses

Please ignore my last entry. I didn't realise I was still using the old version. Now it works perfectly. This is fantastic!!!!

02 Apr 2009 Jeffrey Hall

Could someone please post an example showing some or all of the advanced features that Advanced Polar Plots v2 offers over the regular MATLAB polar() command?

Thanks

03 Apr 2009 Daniel Armyr

Specifically, pp can plot negativ radii. If you type help pp and read through the first few paragraphs, it will tell you.

03 Apr 2009 Jeffrey Hall

Is there anyway that someone could please send me a MATLAB code snippet showing pp.m in all of its glory?

I am evaluating multiple software packages for creating polar plots and am on a tight schedule.

Thanks.

07 Apr 2009 sls

It doesn't seem to work with the function subplot. Any tips? I want to plot multiple polar plots in one figure.

07 Apr 2009 Daniel Armyr

@sls
That is correct. This function has very many limitations. My suggestion is to rewrite the function with a bit less functionality and fewer ugly hacks, or pester your local Mathworks representative to improve the functionality of the built-in polar function.

08 Apr 2009 Daniel Armyr

Sorry, the new file is called 'polar 2' and nothing else.

09 Apr 2009 Noelia Oses

Hi all,
 
I am using pp to plot polar plots and it's great!
However, even though I'm using style 'or' it still plots the lines linking the markers.
Does anyone know what to do so that it doesn't plot the lines?
 
Thank you very much!!
Noelia

20 Apr 2009 Jonas

There is an error at least on OS X - the variables TraceMax and TraceMin are initialized as empty stings, which leads to strange behavior when catenating with doubles.
This leads to the error 'Centre value is same as maximum input value' being thrown erroneously.

I suggest changing lines 1326 and 1313 to
TraceMax = [];
TraceMin = [];
respectively.

01 May 2009 Brian

There is a typographical error in line 180.

'oc_ring_border_line_width'
should be
'oc.ring_border_line_width'

Cheers.

02 May 2009 Daniel Armyr

To be clear, I have given upp support of this function in favour of "polar 2" which can be found here.
http://www.mathworks.com/matlabcentral/fileexchange/23589

Polar 2 has less features, but has relatively cleaner code and is less prone to bugs.

If someone else wants to maintain this file, feel free. Just do the bugfixes and upload it under your own name,

21 Jul 2009 Mohamad

I'm plotting normalized power radiation pattern in dB scale 0 to [-inf]. Your code does not seem to work at all when 0 is defined as the maximum value. When I try with other data with 0 as the least value, your code works awesome.

23 May 2011 Daniel Armyr

As mentioned, use http://www.mathworks.com/matlabcentral/fileexchange/23589 instead.

Please login to add a comment or rating.
Updates
24 Mar 2009

Removed the return argument as it isn't defined anywhere in the function.

Tag Activity for this File
Tag Applied By Date/Time
polar Daniel Armyr 02 Feb 2009 12:59:13
plot Daniel Armyr 02 Feb 2009 12:59:13
graph types Daniel Armyr 24 Mar 2009 01:24:47
antenna Daniel Armyr 24 Mar 2009 01:24:47
graphics Daniel Armyr 24 Mar 2009 01:24:47
specialized Daniel Armyr 24 Mar 2009 01:24:47
polar plots radiation patterns Daniel Armyr 24 Mar 2009 01:24:47
plotting Daniel Armyr 24 Mar 2009 01:24:47
antenna Christian 14 Jun 2011 08:03:51
plotting Volker 07 Jul 2011 04:39:59

Contact us at files@mathworks.com