File Exchange

image thumbnail

pcolor in polar coordinates

version 3.1 (453 KB) by

polarPcolor draws a pseudocolor plot in polar coordinates with a polar grid.

13 Ratings



View License

polarPcolor is a function that aims to represent a pseudocolor plot in polar coordinates, with a radial grid to allow an easy lecture of the data. It is well suited for Plan Position Indicator (PPI) scan for radar or lidar for example [1].

I have seen that [2] has used many years ago an impressive (and well written) function that fulfills +/- the same purpose.


[1] Cheynet, E., Jakobsen, J. B., Snæbjörnsson, J., Reuder, J., Kumer, V., & Svardal, B. (2017). Assessing the potential of a commercial pulsed lidar for wind characterisation at a bridge site. Journal of Wind Engineering and Industrial Aerodynamics, 161, 17-26.


Comments and Ratings (20)

Patrik Eschle

Works like a charm, thank you very much.
It's strange that this is not a standard function inside matlab.

E. Cheynet

E. Cheynet (view profile)

Hi Pritesh,

To create your NxN matrix for the variable Z, you can use the Matlab function "griddata":

Alternatively, you can try to use a scatter plot instead of a pseudo-color plot, as shown below:

hey, really nice piece of work. I have a question particular to my query for your code. I have a 1xN matrice for R and theta. and corresponding 1xN for the Z values. And the cell values in R and theta are not repeating, so I cant really make the Z as NxN matrice with the R and theta having the common values. It was difficult figuring how I could modify your code to suit my requirement. Could you help me out?
This link has an excel sheet with my data points. It would help you understand my question if you just have a look at it. Thanks!

Yuki Kita

blandine GAIO

Very useful! Thanks very much for the great work.

Peng Wang

I tested on R2013b that works great and your example save my time and your code is understandable

Thank you E. Ch3yn3t !!!
It was just what I was looking for.
It is also well explained from your examples.
It works properly on R2013b.

Chi Qiao


Jesper (view profile)


Thank you again for your patience!

E. Cheynet

E. Cheynet (view profile)

If only a small area is of interest, just "crop" your data around this area. That should also speed up the computation since you would have a matrix with a smaller size.


The matter is:
I use you function to plot a figure, for my data is too large(1126*1000), and the quantities of the nonzero data is small, which lead the figure could not display the spot unless you zoom in it.

E. Cheynet

E. Cheynet (view profile)

Since the data are presented in polar coordinates, "axis(xmin,xmax,ymin,ymax)" is unlikely to be directly useful. Here, the limit of the axis are automatically calculated from R and theta. If you want to modify the axis, just change the extrema of R and theta (cf. last 2 paragraph of the html example).



Thank you for your reply!
I mean I want to know whether their is a function like axis(xmin,xmax,ymin,ymax) to control the display of the figure.


It's very kind of you that solve my problem!

E. Cheynet

E. Cheynet (view profile)

hi McChaucey,
Thanks for the suggestion, that is a good idea !
Are you referring to the colorbar axis ? If yes, I use the function "caxis". I have implemented today a new version where the axis is automatically scaled. In the example file, I also illustrate the role of caxis.


It's pretty good,there are 2 questions.
1st,How to adjust the axis.
2nd,Could u share the version that can adjust the axis adaptively, like image to imagesc.





Description updated with an illustration of the method applied to wind data


correction of a bug when Nspokes is lower than Ncircles/2


- automatic scaling of colorbar + new example + multiple options are added


- typo






- updated for 2014b
- code updated
- examples updated






added html example


- picture updated
- specification updated
-label 'distance' updated


- example updated
- axes improved


example corrected




tags modification


More accurate description added

MATLAB Release
MATLAB 8.4 (R2014b)

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video