aboutsummaryrefslogtreecommitdiff
path: root/tex/preamble-pgfplots.tex
blob: c2a7f141db3a11ae65d5c06d935b1f9c4b5a6fbc (plain)
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
%% PGFPlots settings
%% -----------------

%% PGFPLOTS is a package in (La)TeX for making plots internally. It fits
%% nicely with the purpose of a reproduction pipeline. But it isn't
%% mandatory. Therefore if needed, you can just uncomment the line that
%% includes this file in the top LaTeX source (`paper.tex').

%% PGFPlots uses the (La)TeX TiKZ package to build plots. So we will first
%% do the settings that are necessary in TiKZ, and then go onto the actual
%% PGFPlots package.





%% Very general TiKZ settings. In particular, to allow faster processing
%% (not having to re-build the plots on every run), we are using the
%% externalization feature of TiKZ. With this option, TiKZ will build every
%% figure independently in a special directory afterwards it will include
%% the built figure in the final file. This has many advantages: 1) if the
%% code for the plot hasn't changed, then the plot won't be re-made (can be
%% slow with detailed plots). 2) You can use the PDFs of the individual
%% plots for other purposes (for example to include in slides) cleanly.
\usepackage{tikz}
\usetikzlibrary{external}
\tikzexternalize
\tikzsetexternalprefix{tikz/}





%% The following rule will cause the name of the files keeping a figure's
%% external PDF to be set based on the file that the TiKZ commands are
%% from. Without this, TiKZ will use numbers based on the order of
%% figures. These numbers can be hard to manage and they will also depend
%% on order in the final PDF, so it will be very buggy to manage them.
\newcommand{\includetikz}[1]{%
    \tikzsetnextfilename{#1}%
    \input{tex/#1.tex}%
}





%% Uncomment the following lines for EPS and PS images. Note that you still
%% have to use the `pdflatex' executable and also add a `[dvips]' option to
%% graphicx.

%% \tikzset{external/system call={rm -f "\image".eps "\image".ps
%% "\image".dvi; latex \tikzexternalcheckshellescape -halt-on-error
%% -interaction=batchmode -jobname "\image" "\texsource";
%% dvips -o "\image".ps "\image".dvi;
%% ps2eps "\image.ps"}}





%% Inport and configure PGFPlots.
\usepackage{pgfplots}
\pgfplotsset{compat=newest}
\usepgfplotslibrary{groupplots}
\pgfplotsset{
  axis line style={thick},
  tick style={semithick},
  tick label style = {font=\footnotesize},
  every axis label = {font=\footnotesize},
  legend style = {font=\footnotesize},
  label style = {font=\footnotesize}
  }