Color map in polar axes

I have a circular paper. I measure certain acoustic response on that paper. The measurement is taken by a stack of measuring instrument that move from one radial end to other radial end of the paper. So, I have the data in cartesian coordinates but I need to represent it in circular coordinates since the original material is circular in shape. And the plot needs to be a color map (like how pcolor does for cartesian plots). How do I make such color map in a circular plot?
I ave enclosed the X and Y axis values along with the corresponding measured data as TT in the attached excel file. They are in cartesian coordinate. I need to plot them as a color map such that it shows how the measured data is distributed over the circular paper.

Answers (3)

The 'surf' function now works with polar axes as of MATLAb R2025a. The cartesian coordinates can be converted into polar coordinates and the corresponding data can be plotted as a polar plot with colormap using the 'surf' function. Here's some documentation and sample code:
clc
clear
r = linspace(0,100,100);
theta = linspace(0,2*pi,100);
data = r'*sin(theta);
p = polaraxes;
surf(p,theta,r,data)
KSSV
KSSV on 19 Sep 2017

0 votes

Read about cart2pol. This function converts your cartesian coordinates to polar coordinates and then you can use surf or pcolor.

6 Comments

Pritesh Bhoumick
Pritesh Bhoumick on 19 Sep 2017
Edited: Pritesh Bhoumick on 19 Sep 2017
As far as I understand, pcolor or surf dont work with polar coordinates. It only for cartesian coordinates!
KSSV
KSSV on 19 Sep 2017
Have you tried? They will work....the data which you gave is not clear..else I would have showed you....explain your data attached,
Pritesh Bhoumick
Pritesh Bhoumick on 19 Sep 2017
Edited: Pritesh Bhoumick on 19 Sep 2017
Yap I have tried and checked on forums here. They do not work directly. The excel file has three sheets. Sheet named TT is the data to be plotted. The sheets named X and Y represent the corresponding x and y axis coordinates for the same cell references in sheet TT
Pritesh Bhoumick
Pritesh Bhoumick on 19 Sep 2017
Edited: Pritesh Bhoumick on 19 Sep 2017
pcolor only generates a cartesian axes with an x and y axis. I need polar axes being displayed to represent the circular paper on which the measurements were made.
I am also looking for a solution. I am thinking of maybe using the pcolor with the cartesian coordinates and then somehow overlaying a polaraxes object. Though this is appearing to be a lot more work than I had initially anticipated. There is also no way to linkaxes (if that would do anything), as they are not the same coordinate systems.
Patch and surf are supported in polaraxes starting in R2025a.

Sign in to comment.

Aaron Anderson
Aaron Anderson on 20 Sep 2017
Edited: Aaron Anderson on 20 Sep 2017

0 votes

I haven't tested it completely yet but it seems like it will do what we want. To be clear though you will have to convert from cart2pol first.
Just make sure your theta and R are 1xN matrices.

1 Comment

Pritesh Bhoumick
Pritesh Bhoumick on 24 Sep 2017
Edited: Pritesh Bhoumick on 24 Sep 2017
I tried that. I made the theta and R as 1xN matrices. But it needs the data points to be NxN matrice. That I do not have. Because I do not have X values for every possible Y's and vice versa. Have a look at the excel sheet I have shared. Let me know if you can make anything out of that. Thanks!

Sign in to comment.

Categories

Asked:

on 19 Sep 2017

Commented:

on 18 Jun 2025

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!