GPS Colormapping regarding for drone
2 次查看(过去 30 天)
显示 更早的评论
I am currently working on a project which requires coordinate mapping of a drone with respect to it's acceleration at x axis.
Here is the code ı am using to plot lat, lon, acc_x;
close all; clear all; clc;
fileID = fopen ('Test_31_03_2016_2.TXT');
formatSpec = '%s';
N=50;
cac = textscan(fileID,'%fN%fE%f%f%f%f%f%s%f%f', 'Delimiter',',' );
lat=cac{1};
lon=cac{2};
acc_x=cac{10};
acc_x_min = min(acc_x);
acc_x_max = max(acc_x);
meanValue = mean(acc_x);
a=colormap; bigthan = acc_x(:,1) > 340; %Pre-defined value, can be changed.
plot(lon(bigthan),lat(bigthan),'.','MarkerSize',30,'Color',[1 .7 0])
hold on
plot(lon(~bigthan),lat(~bigthan),'.-','MarkerSize',30)
plot_google_map
And here is my output image:
/matlabcentral/answers/uploaded_files/48844/Oldu_beaaah_%C3%B6%C3%B6eeeaaaahhhheee%C3%B6%C3%B6%C3%B6.jpg
Right now i am plotting with respect to 2 acc values, the ones which are greater than 340 (orange) and below 340 (reddish color)
My question is;
I want to plot higher acc values with darker colors and lower acc values with lighter colors. It is my first time with COLOR MAPPING and it's functions so i am not pro-user.
Any kind of help is appreciated.
0 个评论
采纳的回答
Chad Greene
2016-3-31
Hi Ugue,
scatter(lon,lat,60,acc_x,'filled')
where 60 is simply the size of the dots. Add a colorbar like this:
cb = colorbar;
ylabel(cb,'acceleration')
After you have plotted with scatter you can change the colormap to your liking using any of the built-in colormaps, for example
colormap(hot)
or
colormap(gray)
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Orange 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!