-
Notifications
You must be signed in to change notification settings - Fork 2
/
convergencePlot.m
55 lines (44 loc) · 1.13 KB
/
convergencePlot.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
function hand = convergencePlot(orders, h, e)
N = length(orders);
fh = figure();
ah = axes();
ah.XScale = 'log';
ah.YScale = 'log';
hold on
ph = {};
phc = {};
legends = {};
for i = 1:N
ph{i} = loglog(h{i}, e{i});
phc{i} = plotConvergenceFit(orders{i}, h{i}, e{i});
ph{i}.LineStyle = 'none';
ph{i}.Marker = Color.solidMarkers{i};
ph{i}.MarkerSize = 12;
ph{i}.Color = Color.colors{i};
ph{i}.MarkerFaceColor = Color.colors{i};
legends{i} = sprintf('$o = %d$', orders{i});
end
hold off
lh = legend([ph{:}], legends);
lh.Interpreter = 'latex';
lh.Location = 'SouthEast';
for i = 1:N
uistack(phc{i}, 'bottom');
end
xlabel('$h$', 'interpreter', 'latex')
ylabel('Error', 'interpreter', 'latex')
% xlim([0.7e-2, 1e-1])
% ylim([3e-5, 4])
grid on
ah = gca();
ah.TickLabelInterpreter = 'latex';
setFontSize(fh);
% if savePngs
% savepng(fh, 'fig/conv/conv',600)
% end
hand = struct();
hand.fig = fh;
hand.data = ph;
hand.fits = phc;
hand.legend = lh;
end