MATLAB Answers


How can I plot 3D polar plot in MATLAB

Asked by john pappachen on 12 Sep 2017
Latest activity Commented on by Star Strider
on 13 Sep 2017
I have three values, azimuth, elevation and corresponding data points. is it possible to plot 3D polar plot using this three values. and 1 want to show the third value in colour. I am looking forward to hear your suggestions. A sample data is attaching herewith
Thanking You,


Sign in to comment.

1 Answer

Answer by Star Strider
on 12 Sep 2017

There may be File Exchange contributions for 3D polar plots. It is possible to use the sph2cart function to plot your data in 3D, however in Cartesian coordinates, so losing the angle data in the plot.
A 2D polar plot with the values in scaled colour is not difficult to code using the polarscatter function (in R2016b and later):
D = load('data.txt');
Az = D(:,1);
El = D(:,2);
Rd = D(:,3);
cn = ceil(max(El)); % Number Of Colors
cm = colormap(jet(cn));
polarscatter(Az*pi/180, Rd, [], cm(fix(El),:), 'filled')
grid on
Tbis colours the points by the value of ‘El’. Here, since the maximum ‘El’ value defines 21 colours, no scaling of it is needed. In other situations (very high or very low maximum values), scaling would be necessary to get adequate colour definition.


My pleasure.
If my Answer helps you solve your problem, please Accept it!

Sign in to comment.