Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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}
share|improve this question
1  
You can add execute at begin axis={} to the axis options to locally disable the code. –  Jake Jun 24 at 13:43
    
That worked. Please provide your comment as answer so I can mark it as solved. –  henry Jun 24 at 13:52

1 Answer 1

up vote 7 down vote accepted

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

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.