function plot_errors

nodes = [25 50 99 197];

error_avg_EDS = [1.3e-3 1.0e-4 2.0e-5 2.3e-6];
error_max_EDS = [1.6 0.25 0.1 0.023];

error_avg_TDS = [8.1e-4 6.2e-5 7.9e-6 3.9e-7];
error_max_TDS = [0.97 0.15 0.039 0.0038];

hold on
plot(nodes, error_max_EDS, 'ok', 'LineWidth',0.5)
plot(nodes, error_max_TDS, '*k', 'LineWidth',0.5)

% annotation(...
%   'textbox',...
%   'Position',[0.547 0.7401 0.3113 0.1557],...
%   'String',{'cost function'},...
%   'EdgeColor','none',...
%   'FontSize',10,...
%   'Interpreter','latex',...  
%   'FitHeightToText','on');
% 
% annotation(...
%   'textbox',...
%   'Position',[0.547 0.5656 0.3245 0.1733],...
%   'EdgeColor','none',...
%   'FontSize',10,...
%   'String',{'tracking term'},...
%   'Interpreter','latex',...
%   'FitHeightToText','on');
% 
% annotation(...
%   'textbox',...
%   'Position',[0.547 0.142 0.2717 0.1557],...
%   'EdgeColor','none',...
%   'FontSize',10,...
%   'String',{'effort term'},...
%   'Interpreter','latex',...
%   'FitHeightToText','on');

plot(nodes, error_max_EDS, '-o', 'LineWidth',0.5, 'Color', [0 0 0])
plot(nodes, error_max_TDS, '-*', 'LineWidth',0.5, 'Color', [0 0 0])
plot(nodes, error_avg_EDS, '--o', 'LineWidth',0.5, 'Color', [0 0 0])
plot(nodes, error_avg_TDS, '--*', 'LineWidth',0.5, 'Color', [0 0 0])
hold off

%% Create legend
legend({'EDS','TDS'},...
  'Position',[0.5693 0.4258 0.1786 0.1381],...
  'EdgeColor',[1 1 1],...
  'Interpreter','latex');

%title('Cost Function vs. # of Nodes')
xlabel('nodes')
ylabel('rel. error')

%axis([0 200 0 0.16]);
box on
%set(gca,'YGrid','on')

% set(0, ...
% 'defaulttextfontsize', 10, ...
% 'defaulttextfontname', 'cmr', ...
% 'defaultaxesfontsize', 10, ...
% 'defaultaxesfontsize', 10, ...
% 'defaultaxesfontname', 'cmr') 
