6

The code below works as intended and contains a solution to have zero lines (as provided by percusse here). It produces the following picture although the MWE produces an error.

How can I "disable"/deactivate the code in the preamble for this instance? Is that even possible?

Picture

enter image description here

MWE

\documentclass[
11pt,
a4paper
]
{scrreprt}

\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{lmodern}

\usepackage{
    tikz,
    pgfplots,
    pgfplotstable
}

\pgfplotsset{
execute at begin axis={
    \draw[very thin] (axis cs:\pgfkeysvalueof{/pgfplots/xmin},0) -- (axis cs:\pgfkeysvalueof{/pgfplots/xmax},0);
    \draw[very thin] (axis cs:0,\pgfkeysvalueof{/pgfplots/ymin}) -- (axis cs:0,\pgfkeysvalueof{/pgfplots/ymax});
},
}

\begin{filecontents}{data.csv}
year;word
2009;2.448
2010;2.773
2011;3.373
2012;3.952
2013;4.792
\end{filecontents}

\listfiles

\begin{document}
\begin{center}
\begin{tikzpicture}[font=\small]
\begin{axis}[
height=6cm,
%width=14cm,
%
ymin=0,
ymax=12,
%
x tick label style={
    /pgf/number format/1000 sep={},
},
%
xlabel={year},
ylabel={Value in mio. EUR},
]
\addplot+ table [col sep=semicolon, x=year, y=word] {data.csv};
\addlegendentry{\textsc{\large{bmw}}}
\end{axis}
\end{tikzpicture}
\end{center}
\end{document}
henry
  • 6,594

1 Answers1

7

You can add execute at begin axis={} to the axis options to locally disable the code.

Jake
  • 232,450