-
Notifications
You must be signed in to change notification settings - Fork 1
/
LatexPlot.m
29 lines (28 loc) · 988 Bytes
/
LatexPlot.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
classdef LatexPlot
properties (Constant, Access = private)
DEFAULT_FONT_COLOR = 'k'; % black
DEFAULT_BACKGROUND_COLOR = '#FFFFE0'; % yellow
DEFAULT_FONT_SIZE = 14;
end
methods(Static)
% max 8 lines
function show(lines, varargin)
p = inputParser;
addOptional(p, 'FontColor', LatexPlot.DEFAULT_FONT_COLOR);
addOptional(p, 'FontSize', LatexPlot.DEFAULT_FONT_SIZE);
addOptional(p, 'BackgroundColor', LatexPlot.DEFAULT_BACKGROUND_COLOR);
parse(p, varargin{:});
figure;
axis off;
x = -0.1;
y = 1;
for n = 1:length(lines)
line = lines{n};
text(x, y, line, 'Interpreter', 'Latex', 'FontSize', p.Results.FontSize, 'Color', p.Results.FontColor);
y = y - 0.15;
end
set(gcf,'color',p.Results.BackgroundColor);
hold off;
end
end
end