GPS Colormapping regarding for drone
1 view (last 30 days)
Show older comments
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.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/159554/image.jpeg)
0 Comments
Accepted Answer
Chad Greene
on 31 Mar 2016
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)
More Answers (0)
See Also
Categories
Find more on Orange in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!