File Exchange

## pcolor in polar coordinates

version 3.1 (453 KB) by

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

4.66667
13 Ratings

Updated

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.

References:

[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. http://dx.doi.org/10.1016/j.jweia.2016.12.002

Patrik Eschle

### Patrik Eschle (view profile)

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":
https://www.mathworks.com/help/matlab/ref/griddata.html

Alternatively, you can try to use a scatter plot instead of a pseudo-color plot, as shown below:
https://www.mathworks.com/matlabcentral/fileexchange/49488-wind-rose-as-a-scatter-plot

Pritesh Bhoumick

### Pritesh Bhoumick (view profile)

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

Sai Kanth Dacha

### Sai Kanth Dacha (view profile)

Very useful! Thanks very much for the great work.

Peng Wang

### Peng Wang (view profile)

pongthep thongsang

### pongthep thongsang (view profile)

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

Francesco Sermi

### Francesco Sermi (view profile)

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.
Cheers,
FS

Chi Qiao

Jesper

McChaucey

### McChaucey (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.

McChaucey

### McChaucey (view profile)

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).

McChaucey

McChaucey

### McChaucey (view profile)

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

McChaucey

### McChaucey (view profile)

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.

McChaucey

### McChaucey (view profile)

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

 12 Jan 2017 3.1 typo 12 Jan 2017 3.1 Description updated with an illustration of the method applied to wind data 3 Jun 2016 3.1 correction of a bug when Nspokes is lower than Ncircles/2 28 May 2016 3 - automatic scaling of colorbar + new example + multiple options are added 3 Jan 2016 2.1 - typo 3 Jan 2016 2 Description 3 Jan 2016 2 -Description 3 Jan 2016 2 - updated for 2014b - code updated - examples updated 13 Jul 2015 1.7 - 13 Jul 2015 1.7 - 13 Jul 2015 1.7 added html example 5 Feb 2015 1.6 - picture updated - specification updated -label 'distance' updated 19 Jan 2015 1.5 - example updated - axes improved 15 Jan 2015 1.4 example corrected 15 Jan 2015 1.3 - 14 Jan 2015 1.2 tags modification 14 Jan 2015 1.1 More accurate description added
##### MATLAB Release
MATLAB 8.4 (R2014b)