Code covered by the BSD License  

Highlights from
Polar 2

5.0

5.0 | 2 ratings Rate this file 84 Downloads (last 30 days) File Size: 3.56 KB File ID: #23589
image thumbnail

Polar 2

by Daniel Armyr

 

08 Apr 2009 (Updated 14 Apr 2009)

An update to Matlabs built-in polar.m

| Watch this File

File Information
Description

A polar plot script that allows selection of axis limits by the user, including negative radial limits. It is particularly appropriate for logarithmic data.

A known limitation is that datapoints outside the radial limits will still be drawn.

Acknowledgements

The author wishes to acknowledge the following in the creation of this submission:
Advanced Polar Plots v2

MATLAB release MATLAB 7.8 (R2009a)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (13)
15 Jan 2010 Claudio Pedrazzi

I was looking exactly for this! It is strange that the "polar" function supplied by MATLAB does not provide the facility to set the axis limits. Thanks a lot!

20 Jan 2010 Judy

The code is giving me an error of

??? Error using ==> makemcode>local_parse_input
Invalid input

Error in ==> makemcode at 38
[h,options] = local_parse_input(varargin{:});

Error in ==> polar2 at 249
    makemcode('RegisterHandle',cax,'IgnoreHandle',q,'FunctionName','polar');

when I try to plot a simple example for a polar plot with
t = 0:.01:2*pi;
polar2(t,sin(2*t).*cos(2*t))

What is going on?

21 Jan 2010 Daniel Armyr

@Judy:
I redownloaded the code from here, and cut and pasted your two-line example directly into my command window. I get a nice flower-petal plot with no errors.

This file has only been tested with Matlab2009a and 2009b. What version are you running?

21 Jan 2010 Judy

Actually, looking into this more, this actually does plot the graph, but the error keeps coming up, so I just commented the last part out. I don't think it is necessary? What was the purpose for making the mcode at the end? Thank you!!

22 Jan 2010 Daniel Armyr

@Judy: Well, actually. This is the Mathworks original polar.m with just a few modifications to get the features I wanted. So unfortunately, I can't answer for that part of the code since I didn't write it.

19 May 2010 Jerry Gump

Do we have anything that works similar to shade command for rectangular plots? We am making a polar plot and I want to shade the region between the two angles.

20 May 2010 Daniel Armyr

@Jerry: Sorry, there are few options for polar plotting in Matlab. Maybe if you ask in the newsgroup you might find something.

20 May 2010 Jerry Gump

Solution to my question is:

angle=[0.03*pi:0.01*pi:0.25*pi];
radius=ones(size(angle));
radius(1)=0;radius(size(angle))=0;
h=polar(angle,radius,'g');
patch(get(h,'XData'),get(h,'YData'),[0 1 1]);
hold on;
t = 0:.01:2*pi;
polar(t,sin(2*t).*cos(2*t),'r')

25 Jun 2010 Faisal

mr daniel, can u send ur demo on this case..

i have case, and im using ur formula, but... the result i have is strange..
i mean the figure result its not logic to me...

28 Jun 2010 Daniel Armyr

@Faisal: Two examples are provided here in the thread. Try Judy's and Jerrys examples and see where that leads you.

13 Sep 2010 senthil

I am using ur polar2.m file for plotting. If i have some 2000 rho values in set A, Is it possible to push the data (theta) to start from say 700 to 2700. so i the initial part will be blank. This i need to do (by hold ON) on 4 set of values that will be over laid. so finally i will get concentric ring of values while the central 700 region is empty.

14 Sep 2010 Daniel Armyr

@senthil: I am sorry, but I do not udnerstand your question. You seem to have an idea of what your theta values shoudl be. In that case, can't you just set your theta values to what you want and plot it?

19 May 2011 Jochen  
Please login to add a comment or rating.
Updates
14 Apr 2009

Edited the description.

Tag Activity for this File
Tag Applied By Date/Time
antenna Daniel Armyr 08 Apr 2009 09:34:07
graph types Daniel Armyr 08 Apr 2009 09:34:07
graphics Daniel Armyr 08 Apr 2009 09:34:07
plot Daniel Armyr 08 Apr 2009 09:34:07
plotting Daniel Armyr 08 Apr 2009 09:34:07
specialized Daniel Armyr 08 Apr 2009 09:34:07
polar plots radiation patterns Daniel Armyr 08 Apr 2009 09:34:07
polar Daniel Armyr 08 Apr 2009 09:34:07
graph types Carlos Mário Alves 30 Apr 2009 13:26:39
antenna Hamad 28 Nov 2011 00:23:12
polar Nadia 27 Jan 2012 09:01:42

Contact us at files@mathworks.com