Borrar filtros
Borrar filtros

GPS Colormapping regarding for drone

2 visualizaciones (últimos 30 días)
Ugue Halden
Ugue Halden el 31 de Mzo. de 2016
Comentada: Ugue Halden el 31 de Mzo. de 2016
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.

Respuesta aceptada

Chad Greene
Chad Greene el 31 de Mzo. de 2016
Hi Ugue,
Use scatter. To scale the color of dots relative to the acc_x array, all you need is
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)
or you can download nicer colormaps if you want to get real fancy.
  1 comentario
Ugue Halden
Ugue Halden el 31 de Mzo. de 2016
Thank you so much, you are really a life savior.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Orange en Help Center y File Exchange.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by