Newer
Older
function [scatterHandle, textHandles] = plotTimeDivergenceToGpsPositions(pAxesHandle, pTrajectory, pColor, pPlotAsMap)
leprob001
committed
%PLOTTRAJECTORYSURFACEPOSITIONS Summary of this function goes here
% Detailed explanation goes here
%% Get required data
x = pTrajectory.timeDivergenceToGps.longitude;
y = pTrajectory.timeDivergenceToGps.latitude;
dates = pTrajectory.timeDivergenceToGps.date;
leprob001
committed
%% Hold axes
% make handle the current axes
axes(pAxesHandle);
leprob001
committed
hold(pAxesHandle, 'on');
if pPlotAsMap
scatterHandle = scatterm( ...
pAxesHandle, ...
y, ...
x, ...
50, ...
pColor, ...
'filled' ...
);
else
scatterHandle = scatter( ...
pAxesHandle, ...
x, ...
y, ...
50, ...
pColor, ...
'filled' ...
);
end
leprob001
committed
t = artoa.convert.rd2dmy(dates);
leprob001
committed
textHandles = cell(1, length(t));
if pPlotAsMap
for i = 1:length(x)
textHandles{i} = textm( ...
y(i), ...
x(i), ...
{' '; [num2str(t(i, 3)) '-' pad(num2str(t(i, 2)), 2, 'left', '0') '-' pad(num2str(t(i, 1)), 2, 'left', '0') ', ' num2str(dates(i))]}, ...
'FontSize', 10, ...
'Color', pColor ...
);
end
else
for i = 1:length(x)
textHandles{i} = text( ...
x(i), ...
y(i), ...
{' '; [num2str(t(i, 3)) '-' pad(num2str(t(i, 2)), 2, 'left', '0') '-' pad(num2str(t(i, 1)), 2, 'left', '0') ', ' num2str(dates(i))]}, ...
'FontSize', 10, ...
'Color', pColor ...
);
end