# polar countour plot

i have a large table of values where each row corresponds to a radius and each column corresponds to an angle from 0 to 2pi. i'd like to plot this up in a polar coordinate surface graph where each pixel is keystone shaped, but i can't find anything to help me do this. any suggestions? preferably free ones.
LVL 12
Asked:
###### Who is Participating?

Commented:
PAQed with points refunded (500)

Computer101
EE Admin
0

Commented:
What do you mean by pixel being keystone-shaped?
I suppose just converting the polar coordinates to x/y coordinates and plotting it on a scatter graph is not what you want. If it is then the formulas for conversion would be (assuming your angle is in column A, and your value in column b):
=B1*cos(A1*360/(2*PI()))     for X
=B1*sin(A1*360/(2*PI()))    for Y
0

Commented:
Here's a website that shows a bunch of useful tips and tricks. There is a chart there that looks like what you're looking for:
http://www.andypope.info/charts.htm
Good luck,
Pawel
0

Author Commented:
none of those charts are polar contour plots. what i have is something like this:

5 5 5 4 5 5 5
4 4 4 3 4 4 4
3 3 3 2 3 3 3

the columns are the theta coordinate (in this case, pi/3 intervals) and the rows are the r coordinate, 0 to 2. the pixels in the contour will be keystone shaped because the pi coord is fixed, so at each r, you can imagine breaking up a pi slice into lengthwise pieces.
0

Commented:
I would like to help, but I still don't understand what you mean. What are the numbers in the table that you gave above (the one with 5s, 4s, 3s and 2s) if both the radius and the angle is fixed (determined by rows and columns, respectively)? Maybe you could hand-draw what your graph should look like or maybe find an image on the Net that corresponds to your desired outcome and upload it to ee-stuff.com? What do you mean by pixel? The definition of a pixel I am aware of is "the smallest point visible on the screen" and it is always square.

Pawel
0

EngineerCommented:
This is what I understand from your explanation.

https://filedb.experts-exchange.com/incoming/ee-stuff/4867-PolarContour.zip

If you change the Pi-Interval and/or the R-values you shall have to rerun the macro.

Saqib
0

Commented:
Saqib,

I think a better description of your chart would be a 'cobweb' chart.

Patrick
0

Commented:
craskin,

Can I suggest that if you have not yet got the answer you're looking for, you draw out the chart you are wanting on a piece of paper, using the coordinates you have given, scan it, save it as a bitmap (.bmp) file and upload the file for us all to see. You will find free file upload services at these sites:

http://yourfilehost.com
http://storenow.net/
http://www.rapidupload.com/
http://rapidshare.de
http://briefcase.yahoo.com
http://geocities.yahoo.com
http://yousendit.com
http://www.ee-stuff.com

Important: Remember to copy the  link before you leave their webpage and then quote it here.

Or

If you upload the workbook to www.ee-stuff.com you will need to do the following:

1. Zip the file
2. Login with the same details as for Experts Exchange
3. Select the Expert tab, and choose the Upload a new file link
4. Enter the question number. From a URL extract question number. For example if the URL is:

experts-exchange.com/Software/Office_Productivity/Office_Suites/MS_Office/Excel/Q_22753995.html

then enter the question number as  - 22753995
5. Browse to your *zipped* file, enter a comment of some sort (it doesn't matter what) and press Upload
6. You will see a page with two links to the file - copy the second one and post it here. If there are no links, then the file failed to upload.

Patrick
0

Author Commented:
saqib's excel sheet looks like it might be on the right track, but i can't tell what it's doing. anyway, i'm looking for something like this:

http://www.ncl.ucar.edu/Applications/Images/polar_8_lg.png

to be produced from a flat table of data like saqib's excel sheet. i can reorder the data any way i'd like since it's coming out of a vb program i wrote, so that's not a problem. i would rather not convert to x and y coords, though, because like i've said, the contour pixels are not square, and saqib's graph is more accurate to what the shape of the pixels is.
0

Author Commented:
0

Commented:
Neither of those pictures gets even close to your description of 'contour will be keystone shaped' - most confusing. Perhaps you'd like to explain again.
0

Author Commented:
the elements of this grid are keystone shaped.

http://www.intmath.com/Plane-analytic-geometry/polar-mt.gif
0

Commented:
That's clear - thanks
0

Commented:
craskin,

I believe I understand what you are wanting to do. It is not hard to create a grid but as Excel does not allow only a segment of a circle to be drawn it is not possible to fill only a segment (keystone shaped) with a colour. If you want just a line superimposed on top of the grid then that is certainly possible.

Here's a file with a grid (not yet completed) which might be a starting point. Let me know whether it's the way you want to go and if just a line plot on top would do what's wanted:

http://www.yourfilehost.com/media.php?cat=other&file=circles_02.xls

The grid is created with by a macro (not in that file).

Patrick
0

Author Commented:
it doesn't matter if the gridlines are visible, it only matters that converting to x,y will give the wrong result.
0

Commented:
I still have no idea as to what is the answer to my question. It was:

Let me know whether it's the way you want to go and if just a line plot on top would do what's wanted.
0

Author Commented:
a line plot won't really work. i'm modeling star formation in a galaxy and the contour plot is supposed to show surface brightness.
0

Commented:
I'm close to giving up as the feedback is not enough to make progress. However here's a radar chart of your data:

http://www.yourfilehost.com/media.php?cat=other&file=craskin_01.xls
0

Commented:
>a line plot won't really work.

Understood. I think you should be investigating totally different software to achieve what you want.
0

Author Commented:
this question was cross-posted in excel and vb.net. i thought there might've been a way to do this with an excel macro, but it looks as though the biggest hurdle was just getting people to understand what a polar contour plot is. if a radar plot or a line plot on a circular grid is all that can be accomplished with excel, then yes, i'll need to use something else, like the GDI+ in vb.net.
0

Commented:
craskin,

As I suggested yesterday, if you had taken a little time to draw by hand an example with data, scanned and uploaded the file it would have saved you and others a lot of head-scratching.

Good luck in your search for suitable software to do what you want.

Patrick
0

Commented:
One final shot with a donut chart:

http://www.yourfilehost.com/media.php?cat=other&file=craskin_02.xls

It does at least have keystone shaped segments.
0

EngineerCommented:
Craskin, Can you post input data for one of the above-posted diagrams? Those diagrams are doable with input data.

VBA can do wonders if used appropriately.

Saqib
0

Author Commented:
that just increases the angular width of the segments by the amount in the cell. the data i have is intensity as a function of (r,theta). the intensity can be thought of as the value of the z coord in cylindrical coordinates so it would create a surface, but what i need is a contour plot. i did a search and found this software that does it with functions, but not tabular data.

http://topangasoftware.com/topanga/Default.aspx
0

EngineerCommented:
Can you throw in some values please? Possibly part of your table? It is going to be much difficult for me to generate some.

Saqib
0

Author Commented:
have a look at this csv file. it's the output of one of my simulations.

http://www.orbitfiles.com/download/id1996819589
0

Author Commented:
and this is what happens if i convert to x,y coords.

http://www.orbitfiles.com/download/id1997121227

you'll notice a bunch of zeros in radial lines between the cells where there's data. those zeros really shouldn't be there because the data in actuality extends into those cells as well, but a simple conversion to x,y doesn't do that.
0

Author Commented:
i figured out how to do this in vb. i just needed to interpolate from the r,theta to x,y rather than simply converting. here's my code for my own and anyone else's reference.

Dim L As Integer = Math.Truncate(dt.Rows.Count / Math.Sqrt(2))
Dim R As Integer = dt.Rows.Count

Dim dtp As New DataTable
For x As Integer = -R To R
dtp.Columns.Add("x=" & x, System.Type.GetType("System.Single"))
Next

For y As Integer = -R To R
Dim newRow As DataRow = dtp.NewRow
For x As Integer = -R To R
If x <> 0 And Math.Sqrt(x ^ 2 + y ^ 2) < R Then
newRow.Item("x=" & x) = dt.Rows(CInt(Math.Truncate(Math.Sqrt(x ^ 2 + y ^ 2)))).Item(CInt(Math.Truncate(2 * Math.PI / R * Math.Atan(y / x))))
Else
newRow.Item("x=" & x) = 0
End If
Next
dtp.Rows.Add(newRow)
Next
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

## Already a member? Login.

All Courses

From novice to tech pro — start learning today.