Mercurial > repos > public > sbplib
comparison convergencePlot.m @ 713:348d5bcf7daf feature/quantumTriangles
Merge with feature/frids
author | Ylva Rydin <ylva.rydin@telia.com> |
---|---|
date | Tue, 20 Feb 2018 15:00:30 +0100 |
parents | 38446922c32a |
children |
comparison
equal
deleted
inserted
replaced
712:c9147e05d228 | 713:348d5bcf7daf |
---|---|
1 function hand = convergencePlot(orders, h, e) | |
2 N = length(orders); | |
3 | |
4 fh = figure(); | |
5 ah = axes(); | |
6 ah.XScale = 'log'; | |
7 ah.YScale = 'log'; | |
8 hold on | |
9 ph = {}; | |
10 phc = {}; | |
11 legends = {}; | |
12 for i = 1:N | |
13 ph{i} = loglog(h{i}, e{i}); | |
14 phc{i} = plotConvergenceFit(orders{i}, h{i}, e{i}); | |
15 | |
16 ph{i}.LineStyle = 'none'; | |
17 ph{i}.Marker = Color.solidMarkers{i}; | |
18 ph{i}.MarkerSize = 12; | |
19 ph{i}.Color = Color.colors{i}; | |
20 ph{i}.MarkerFaceColor = Color.colors{i}; | |
21 | |
22 legends{i} = sprintf('$o = %d$', orders{i}); | |
23 end | |
24 hold off | |
25 | |
26 lh = legend([ph{:}], legends); | |
27 lh.Interpreter = 'latex'; | |
28 lh.Location = 'SouthEast'; | |
29 | |
30 for i = 1:N | |
31 uistack(phc{i}, 'bottom'); | |
32 end | |
33 | |
34 xlabel('$h$', 'interpreter', 'latex') | |
35 ylabel('Error', 'interpreter', 'latex') | |
36 | |
37 % xlim([0.7e-2, 1e-1]) | |
38 % ylim([3e-5, 4]) | |
39 | |
40 grid on | |
41 | |
42 ah = gca(); | |
43 ah.TickLabelInterpreter = 'latex'; | |
44 setFontSize(fh); | |
45 | |
46 % if savePngs | |
47 % savepng(fh, 'fig/conv/conv',600) | |
48 % end | |
49 | |
50 hand = struct(); | |
51 hand.fig = fh; | |
52 hand.data = ph; | |
53 hand.fits = phc; | |
54 hand.legend = lh; | |
55 end |