2

I am plotting the azimuth and elevation of some satellites, where the color of each trajectory represents the S4 index, from low (blue) to high (red). I would like however, to be able to format the colors and corresponding values, so that more of the lower effects of scintillation can actually be distinguished. This is because the high end of scintillation (red) only shows one or two points. Here is a picture of the trajectory and the code.

satellite trajectory showing color coded scintillation

clc; close all; clear all
load combo_323_full
circular_plot
x = [];
y = [];
for s = 1:samples       
  % plot each satellite location for that sample
  for sv = 1:sats
    % check if positive or negative elevation
    if (elevation((s - 1) * sats + sv) < 0)
      elNeg = 1;
    else
      elNeg = 0;
    end
    % convert to plottable cartesian coordinates
    el = elevation((s - 1) * sats + sv);
    az = azimuth((s - 1) * sats + sv);
    x = [x;(pi/2-abs(el))/(pi/2).*cos(az-pi/2)];
    y = [y;-1*(pi/2-abs(el))/(pi/2).*sin(az-pi/2)];
    % check for final sample
%     if (s == samples)
%       plot(x,y,'r*');
%       text(x,y+.07,int2str(SVs(sv)), ...
%            'horizontalalignment', ...
%            'center','color','r');
%     else
      % check for +/- elevation
%       if (elNeg == 0)
%         plot(x,y,'.','color',rgb('DarkBlue'));
%       else
%         plot(x,y,'g.');
% %       end
%     end
  end
end
z = combo(:,5);
for j = 1:10
%     hold on
%     circular_plot
lRef = length(x);
l1 = floor(lRef*(1/100));
l2 = floor(l1*j);
x_time = x(1:l2);
y_time = y(1:l2);
zr = z(1:l2);

navConstants;

% find out from 'plotMat' if plotting satellite locations or trajectories in
% addition determine how many satellites are being tracked and how many
% samples for each satellite (# samples / satellite must always be equal)
gpsTime = combo(1,2);
i = 1;
t = gpsTime;
while ((i ~= size(combo,1)) & (t == gpsTime))
  i = i + 1;
  t = combo(i,2);
end
if (t == gpsTime)
  sats = i;
else
  sats = i - 1;
end;
samples = size(combo,1) / sats;
SVs = combo(1:sats,1);
elevation = combo(:,20).*pi/180;
azimuth = combo(:,19).*pi/180;
% initialize polar - plotting area
figure(j);
axis([-1.4 1.4 -1.1 1.1]);
axis('off');
axis(axis);
hold on;
% plot circular axis and labels
th = 0:pi/50:2*pi;
x_c = [ cos(th) .67.*cos(th) .33.*cos(th) ];
y_c = [ sin(th) .67.*sin(th) .33.*sin(th) ];
plot(x_c,y_c,'color','w');
text(1.1,0,'90','horizontalalignment','center');
text(0,1.1,'0','horizontalalignment','center');
text(-1.1,0,'270','horizontalalignment','center');
text(0,-1.1,'180','horizontalalignment','center'); 
% plot spoke axis and labels
th = (1:6)*2*pi/12;
x_c = [ -cos(th); cos(th) ];
y_c = [ -sin(th); sin(th) ];
plot(x_c,y_c,'color','w');
text(-.46,.93,'0','horizontalalignment','center');
text(-.30,.66,'30','horizontalalignment','center');
text(-.13,.36,'60','horizontalalignment','center');
text(.04,.07,'90','horizontalalignment','center');

scatter(x_time,y_time,3,zr)
colorbar
axis equal
end
4

1 に答える 1

4

独自のcolormapを作成できます。これは、列がそれぞれ赤、緑、青のコンポーネントである N 行 3 列の行列です。

デフォルトのカラーマップは ですjet。たとえば、入力すると

>>> jet(16)

16 x 3 のマトリックスが得られ、それがどのように作成されたかを見ることができます。

その後、使用colormap(your_own_colormap)して変更します。

于 2012-12-12T03:16:56.130 に答える