[plotting] add annonation plot

This commit is contained in:
Jan Grewe 2017-11-10 18:02:47 +01:00
parent ab11681d0f
commit 7461a83158
2 changed files with 20 additions and 0 deletions

View File

@ -0,0 +1,20 @@
time = 0.0:0.001:1.0;
y = sin(2 * pi * 2 .* time);
figure
hold on
set(gcf, 'Color', 'white', 'PaperUnit', 'centimeters', 'PaperSize', [4 4], ...
'PaperPosition', [0 0 4 4])
plot(time, y)
plot([0.0 1.0], [0.0 0.0], '--', 'color','k', 'linewidth', 0.75)
xlim([0, 1.0])
ylim([-1.5 1.5])
text(0.85, -1.2, 'a text', 'Fontsize', 7, 'Color', 'red')
annotation('textarrow', [0.45 0.75], [0.2 0.225], 'String', 'look here', ...
'Fontsize', 7, 'HeadWidth', 2, 'HeadLength', 2);
annotation('doublearrow', [0.22 0.62], [0.8 0.8], ...
'Head1Width', 2, 'Head1Length', 2, 'Head2Width', 2, 'Head2Length', 2);
saveas(gcf, 'annotations', 'pdf')

Binary file not shown.