How can I plot 3D polar plot in MATLAB

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,

 Respuesta aceptada

Star Strider
Star Strider el 12 de Sept. de 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));
figure(2)
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.

5 comentarios

john pappachen
john pappachen el 13 de Sept. de 2017
Thanks
Star Strider
Star Strider el 13 de Sept. de 2017
My pleasure.
If my Answer helps you solve your problem, please Accept it!
Freddy Ngankam
Freddy Ngankam el 29 de Abr. de 2020
hello,
please i have a 48x18 Matrix. the first columb ist the azimuth, the second ist the elongation and the rest of the columbs are my data. i want to plot each datacolum a 3d-plot but i am trying it since two week without succes
can you helpme please ( i am knew in matlab)
thank you
Alexi
Alexi el 14 de En. de 2023
Hi thanks for your reply, How can we print the magnitudes of the values ​​of the points on the points?
Star Strider
Star Strider el 14 de En. de 2023
@Alexi — Use the text function. See the documentation section on Input Arguments.
@Freddy Ngankam — You would likely need to use the pol2cart function, and then plot them in Cartesian coordinates.
.

Iniciar sesión para comentar.

Más respuestas (1)

Juan Esteban Villegas
Juan Esteban Villegas el 26 de Mayo de 2021

0 votos

Hey I made this function to plot a scatter 3d plot, it is rather raw but it does the job maybe you can modify it to make it better.
Best
Juan

3 comentarios

hema vardhan patti
hema vardhan patti el 3 de Mayo de 2023
Hey, I really need the syntax for this plot. Will help me a lot in my thesis
Juan Esteban Villegas
Juan Esteban Villegas el 3 de Mayo de 2023
Hey Hema, you can use something like:
theta = linspace(0,10*pi,401);
phi = linspace(-pi/2,pi/2,401);
rho = linspace(1,1,401);
polarscatter3(theta,phi,rho,'x','r','LineWidth',0.5)
hema vardhan patti
hema vardhan patti el 4 de Mayo de 2023
Thank you for responding Juan, But how to get from a table of values or excel.

Iniciar sesión para comentar.

Categorías

Más información sobre Polar Plots en Centro de ayuda y File Exchange.

Preguntada:

el 12 de Sept. de 2017

Comentada:

el 4 de Mayo de 2023

Community Treasure Hunt

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

Start Hunting!

Translated by