-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathplot_Rand.asv
52 lines (41 loc) · 1.63 KB
/
plot_Rand.asv
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
function [ output_args ] = plot_Rand( Position )
% Plot the trajectory
TJ_MAX = length(Position);
figure(1);
Margin = 1.1;
ColorOrder = makeColorMap([0 1 0],[1 0 0],[0 0 1],TJ_MAX);
%Plot the first point (as the original point)
scatter(Position{1}.LongitudeWsu,Position{1}.LatitudeWsu,50)
%Plot the trajectory in one map
for i=1:TJ_MAX
disp(['i = ' num2str(i)]);
LoLa = [Position{i}.LongitudeWsu,Position{i}.LatitudeWsu];
% NBus = length(LoLa(:,1));
% ColorOrder_S = makeColorMap([0,0,0],[1,1,1],NBus);
% ColorOrder_L = makeColorMap([1,0,0],[1,1,1],NBus);
hold on;
scatter(LoLa(1,1),LoLa(1,2),50,'markeredgecolor','w');
scatter(LoLa(end,1),LoLa(end,2),50,'d','markeredgecolor','w');
plot(LoLa(:,1),LoLa(:,2),'linewidth',2,'color',ColorOrder(i,:));
% for j=NBus:-5:1
% plot(LoLa(j,2),LoLa(j,1),'.','MarkerSize',10,'color',ColorOrder_S(j,:));
% plot(LoLa(j,4),LoLa(j,3),'.','MarkerSize',10,'color',ColorOrder_L(j,:));
% hold on;
% end
end
xlim = [-83.82,-83.64];ylim = [42.22,42.34];
New_xlim(1) = sum(xlim)/2 - (xlim(2)-xlim(1))/2*Margin;
New_xlim(2) = sum(xlim)/2 + (xlim(2)-xlim(1))/2*Margin;
New_ylim(1) = sum(ylim)/2 - (ylim(2)-ylim(1))/2*Margin;
New_ylim(2) = sum(ylim)/2 + (ylim(2)-ylim(1))/2*Margin;
axis([New_xlim New_ylim]);
xlabel('Longitude(deg)');
ylabel('Latitude(deg)');
set(gca,'fontsize',18);
plot_google_map('APIKey','AIzaSyDFTvS9Thk9InCJbjDqjWQ6_wbyFlZxlXA ','MapType','satellite');
% lat = [42.365 42.367];
% lon = [-83.70232 -83.70232];
% plot(lon,lat,'linewidth',16);
% axis([-83.705 -83.699 42.364 42.367]);
% plot_google_map()
end