3 datasets on one skyplot
조회 수: 4 (최근 30일)
이전 댓글 표시
%Example of the data i have for one sateliite
elevation = [30; 60; 90];
azimuth = [60; 90; 120];
MP = [0.2; 0.7; 0.9];
figure()
skyplot(azimuth, elevation)
% How do i include MP to this skyplot in such a way that colour gradient represents the magintude of MP
댓글 수: 2
채택된 답변
Arka
2023년 3월 7일
Hi,
I tried to implement what you wanted using polarplot instead of skyplot.
elevation = [30; 60; 90];
azimuth = [60; 90; 120];
MP = [0.2 0.7 0.9];
cmap = flipud(jet(256)); % color map from blue to red
min_MP = min(MP);
max_MP = max(MP);
c = interp1(linspace(min_MP, max_MP, size(cmap,1)), cmap, MP);
% plot each value pair individually using polarplot
figure;
for i = 1:length(elevation)
h = polarplot(deg2rad(azimuth(i)), elevation(i), 'o', 'MarkerSize', 10, 'MarkerFaceColor', c(i,:), 'MarkerEdgeColor', 'k');
hold on;
end
%skyplot(azimuth, elevation, MP, 'o', 'MarkerSize', 10, 'MarkerFaceColor', c, 'MarkerEdgeColor', 'k');
set(gca, 'ThetaZeroLocation', 'top', 'ThetaDir', 'clockwise', 'RTick', [0 30 60 90], 'GridColor', 'k', 'GridAlpha', 0.2);
Here, the closest satellite has the warmest colour. If you want the opposite colour coding, instead of cmap = flipud(jet(256));, do cmap = jet(256);
To learn more about polarplot, please go through the MathWorks documentation link below:
댓글 수: 3
Arka
2023년 3월 8일
You can try removing the corresponding data points containing NaNs from all 3 vectors.
추가 답변 (0개)
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!