4.76471

4.8 | 17 ratings Rate this file 115 Downloads (last 30 days) File Size: 1.09 MB File ID: #7656

3D Polar Plot

by J De Freitas

 

13 May 2005 (Updated 08 Mar 2006)

Plots 3D polar data with axes.

Editor's Notes:

This file was a File Exchange Pick of the Week

| Watch this File

File Information
Description

Polar3D plots 3 dimensional data given angular and radial ranges. A choice of plot types and interpolation methods is supported by this function. Useful particularly in producing 3D plots sampled on a uniform spacing over a disc.

Version 1.2 introduces the new ?meshl? plot option that allows the user to plot the data without interpolation or modification to the input Zin, and adds a polar axis with suitable tick marks and labels. The output of this option returns the input unchanged as well as the corresponding x and y coordinates, both being the same size as Zin. The ?contourf? plot option has been replaced by the ?meshl? option in this version.

Polar3D(Zin,theta_min,theta_max,Rho_min,Rho_max,meshscale) produces a mesh plot of the data Zin, between theta_min and theta_max, radii Rho_min and Rho_max, with the size of the mesh squares being determined by meshscale; meshscale takes on any real positive value.

Polar3D(Zin,...,plotspec) plots the data as 'surf', 'surfc', 'contour' etc, as set by plotspec.

Polar3D(Zin,..., interpspec) plots the data as mesh plot with 2D 'linear', 'cubic', etc, interpolation over the input data. No interpolation is carried out if the ?meshl? option is used.

[x,y,z] = Polar3D(Zin,...,'off') disengages the plot function and returns the (x,y,z) plot data.

Example:
P = peaks(49);
polar3d(20*P,13*pi/180,pi/2.31,70,320,1,'meshl');

Version History.

Version 1.1. (June 2005). meshscale updated so that Polar3D could take on both integer and non-integer values greater than 0.
Version 1.2. (Mar 2006) introduced the ?meshl? plot option.

Acknowledgements
This submission has inspired the following:
Fiber modes, Zernike calculaor, 3D Polar Plot
MATLAB release MATLAB 7 (R14)
Other requirements None
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (21)
20 May 2005 Elva Robinson

Well documented and easy to use function. It has made my life a lot easier!

12 Aug 2005 Teemu Teekkari

Excellent program, but I'm still missing one function. I'd need a program that plots a continous 2D intensity graph in rainbow colors and polar coordinates. Like pcolor but in polar coordinates. I'd be grateful if you'd include that in the next version.

17 Oct 2005 Afaq Ahmad  
27 Oct 2005 Y han  
17 Nov 2005 Ernst Eiper

It is a perfect function for plotting any kind of intensity data in cylindrical coordinates. What I am still missing is the feature to set the z axis to logarithmic scale. If it is easy for you .. could you please include this feature in your function
Thanx

21 Nov 2005 Ravi M R

What I was expecting was the horizontal plane to represent angle (in degree/radians) like "polar" function of matlab

19 Dec 2005 Chris Chris

Very good code with nice output. The restrictions on the input format can get cumbersome and hard to understand, but once you get used to them it works very well.

02 Jan 2006 hu st

Good functions with clear instructions..
and an aid for programming methods

23 Feb 2006 Spencer Chen

All good. Except Matlab somehow cannot handle 'contourf' in this context.

10 Jun 2006 weijunzhao zhao

it works well

23 May 2007 Zygmunt Klusek

My congratulations. Excellent work. Thank You

16 Jan 2008 Gao Yueming

Thank you!

25 Jan 2008 Danilo Hollosi

Excellent work! Thanks for that:-)
By the way: if you delete the for-statement in "transposing and setting up the magnitude matrix (line 287) and write
P(:,1:c) = temp(:,c-[1:c]+1); instead,
the computanional speed increeses, especialy for large inputdata.

22 Feb 2008 Ping Su

I think it will be very helpful.

23 Jun 2008 Mehmet E Yavuz

Definitely a very helpful tool.

19 Oct 2008 supot endoo

good

23 Mar 2009 Harun

now I will try to use this program... I will write here my experience related to it....

29 Jul 2010 BD Knight

Cool. How can I set meshscale independently for rho and theta?

28 Aug 2010 Mustafa

Phenomenal Program. You guys absolutly rock.
@Teemu Teekkari
you can use polar3d to output the x,y,z values. THen use surf to make the plot. In suck you can turn off the grid lines. I think that should do what your trying to do.

21 Jan 2011 Hongxiao Jin

Really great! Your job makes life easier.
while Line 317, 318 should be like this

step = (c-1)/(r-1); %1:r change to 1:c
[X1,Y1] = meshgrid(1:c,1:step:c); %start from 1 not 0

to get correct interpolation result of more angle columns.

Otherwise I get asymmetrical interpolation on both sides of 0/360.

25 Jul 2011 sridhar

I am getting the below error while trying to run your _demo program

??? Error using ==> polarplot3d at 153
Error parsing varargin list
??? Error using ==> lower
Cell elements must be character arrays.

Can you let me know what needs to be fixed to sucessfully run the program?

Please login to add a comment or rating.
Updates
08 Jun 2005

New Version 1.1.

08 Mar 2006

Version 1.2

Tag Activity for this File
Tag Applied By Date/Time
specialized J De Freitas 22 Oct 2008 07:48:32
plotting J De Freitas 22 Oct 2008 07:48:32
3d J De Freitas 22 Oct 2008 07:48:32
polar J De Freitas 22 Oct 2008 07:48:32
plot J De Freitas 22 Oct 2008 07:48:32
graphics J De Freitas 22 Oct 2008 07:48:32
polar cao ?? 14 Nov 2010 01:18:44
polar perapon fakcharoenphol 01 Dec 2010 13:00:00
really great Hongxiao Jin 21 Jan 2011 08:22:12
3d Santiago Ortiz 22 Aug 2011 04:56:55
polar Morten 08 Nov 2011 04:47:33

Contact us at files@mathworks.com