Newer
Older
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
\usepackage{pgfplots}
\pgfplotsset{compat=1.11} % FIXME: 1.12 would be nice; debian:8.7 only has 1.11
\usepackage{pgfplotstable}
\usepgfplotslibrary{groupplots}
\usepgfplotslibrary{statistics}
\usepgfplotslibrary{units}
%% Typeset the mu from '[xy] SI prefix=micro' as an upright mu
%% From https://tex.stackexchange.com/a/224574
\pgfplotsset{
x SI prefix/micro/.style={/pgfplots/axis base prefix={axis x base 6 prefix \micro}},
y SI prefix/micro/.style={/pgfplots/axis base prefix={axis y base 6 prefix \micro}},
z SI prefix/micro/.style={/pgfplots/axis base prefix={axis z base 6 prefix \micro}},
unit code/.code 2 args={\si{#1#2}},
}
%% Add support for 'groupplot [xy]label'
%% From http://tex.stackexchange.com/a/117935/16940, see also
%% https://sourceforge.net/p/pgfplots/feature-requests/48/
\makeatletter
\pgfplotsset{
groupplot xlabel/.initial={},
every groupplot x label/.style={
at={($({\pgfplots@group@name\space c1r\pgfplots@group@rows.west}|-{\pgfplots@group@name\space c1r\pgfplots@group@rows.outer south})!0.5!({\pgfplots@group@name\space c\pgfplots@group@columns r\pgfplots@group@rows.east}|-{\pgfplots@group@name\space c\pgfplots@group@columns r\pgfplots@group@rows.outer south})$)},
anchor=north,
},
groupplot ylabel/.initial={},
every groupplot y label/.style={
rotate=90,
at={($({\pgfplots@group@name\space c1r1.north}-|{\pgfplots@group@name\space c1r1.outer
west})!0.5!({\pgfplots@group@name\space c1r\pgfplots@group@rows.south}-|{\pgfplots@group@name\space c1r\pgfplots@group@rows.outer west})$)},
anchor=south
},
execute at end groupplot/.code={%
\node [/pgfplots/every groupplot x label]
{\pgfkeysvalueof{/pgfplots/groupplot xlabel}};
\node [/pgfplots/every groupplot y label]
{\pgfkeysvalueof{/pgfplots/groupplot ylabel}};
}
}
\def\endpgfplots@environment@groupplot{%
\endpgfplots@environment@opt%
\pgfkeys{/pgfplots/execute at end groupplot}%
\endgroup%
}
\makeatother
%% Have \includegraphics{} support tikz files
\usepackage{tikzscale}