Skip to content
Snippets Groups Projects
plotTimeDivergenceToGpsPositions.m 1.58 KiB
Newer Older
function [scatterHandle, textHandles] = plotTimeDivergenceToGpsPositions(pAxesHandle, pTrajectory, pColor, pPlotAsMap)
%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;

% make handle the current axes
axes(pAxesHandle);

if pPlotAsMap
    scatterHandle = scatterm( ...
        pAxesHandle, ...
        y, ...
        x, ...
        50, ...
        pColor, ...
        'filled' ...
    );
else
    scatterHandle = scatter( ...
        pAxesHandle, ...
        x, ...
        y, ...
        50, ...
        pColor, ...
        'filled' ...
    );
end
t = artoa.convert.rd2dmy(dates);
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