How can I plot 3D polar plot in MATLAB
141 次查看(过去 30 天)
显示 更早的评论
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,
0 个评论
采纳的回答
Star Strider
2017-9-12
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 个评论
Alexi
2023-1-14
Hi thanks for your reply, How can we print the magnitudes of the values of the points on the points?
Star Strider
2023-1-14
@Freddy Ngankam — You would likely need to use the pol2cart function, and then plot them in Cartesian coordinates.
.
更多回答(1 个)
Juan Esteban Villegas
2021-5-26
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 个评论
Juan Esteban Villegas
2023-5-3
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
2023-5-4
Thank you for responding Juan, But how to get from a table of values or excel.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Polar Plots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!