...
f1 = figure;
firstax = axes (f1, 'FontSize', 16);
L1 = plot (f, '-', 'LineWidth', 2, 'Color', [0 84 159]/255, 'Parent', firstax);
set(firstax, 'Box', 'off','XLim',[0 100]);
legend(firstax, L1, {'4 A'}, 'Location', 'southeast');
hold on
secondax = copyobj(firstax, gcf);
delete( get(secondax, 'Children'))
H1 = plot(k, '-', 'LineWidth', 2, 'Color', [0 0 0]/255, 'Parent', secondax, 'Visible', 'off');
H2 = plot(r, '--', 'LineWidth', 2, 'Color', [0 0 0]/255, 'Parent', secondax, 'Visible', 'off');
set(secondax, 'Color', 'none', 'XTick', [], 'YAxisLocation', 'right', 'Box', 'Off')
legend ([H1 H2], {'Model', 'Catalogue'}, 'Location', 'northeast');
hold off
xlabel('Current [A]');
ylabel('Voltage [V]');
Best Answer