Rather than define a single decorator for all lines at the tikzpicture level, I'd like to use scopes to selectively apply certain decorations to certain parts of my drawing. As a minimal example:
\documentclass{minimal}
\usepackage{tikz}
\usetikzlibrary{decorations}
\begin{document}
\begin{tikzpicture}
%%% Draw the axis.
\begin{scope}[decoration={ticks}]
\draw [->] (0,0) -- (8,0);
\draw [decorate] (0,0) -- (8,0);
\end{scope}
\end{tikzpicture}
\end{document}
This should produce an axis eight units long with tick marks, and the decoration should not "bleed" into other areas of the figure.
Instead, I get an axis, but no tickmarks!
EDIT: It turns out, calling \usetikzlibrary{decorations} in the preamble doesn't work. Instead, use \usetikzlibrary{decorations.pathreplacing}. Can anyone tell me why loading the whole decorations library doesn't work?
scale(there is a]missing anyway). Thanks. – Martin Scharrer♦ Mar 1 '11 at 17:22articleorminimalclass doesn't matter. The minimal refers to no unrelated code, not to theminimalclass. Also you should put an @Martin in your comment so that I get notified about your comment. This isn't required for the original author of the question or answer, which is the reason I skipped the @jrhorn424 in my comments. – Martin Scharrer♦ Mar 1 '11 at 17:27decorations.pathmorphing), it complains about not knowing theaxiskey. Is this a style you defined yourself somewhere else? Also, if you manage to find a solution to your problem, you can post that as an answer and accept it, to close the issue. – Jake Mar 1 '11 at 17:48\usetikzlibrary{decorations}result in thedecorations.pathmorphinglibrary also be loaded, it's better to think ofdecorationsas a base library anddecorations.pathmorphingas an extension, rather thandecorations.pathmorphingas a sub-library ofdecorations. The dot doesn't have any special LaTeX meaning here; it's just the file that contains the code is calledtikzlibrarydecorations.pathmorphing.code.tex. – Matthew Leingang Mar 1 '11 at 18:18