What is the best way to draw braces between tick marks? It would be convenient to assign nodes at tick marks, is this doable?
The best method for placement that I have right now is a guess-and-check.
MWE:
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{patterns,decorations.pathreplacing}
\usepackage{pgfplots}
\pgfplotsset{compat=1.10}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
axis x line = middle,
axis y line = middle,
xticklabels={}
]
\addplot [domain=-1:5] { -x * (x-4) };
\end{axis}
\draw [thick,decoration={brace,mirror},decorate] (1.2,3) -- (5.7,3) node[midway,below,yshift=-.1cm] {4};
\end{tikzpicture}
\end{document}
clip=false
, since my graph would have extended out as well. To fix all this, I usedafter end axis/.code={\draw [decoration={brace},decorate] (A) -- (B) node {yadda};
in the argument of\begin{axis}
, and\coordinate (A) at (axis cs:pi,0);
,\coordinate (B) at (axis cs:5*pi/3,0);
just before\end{axis}
. I hope this helps anyone else who might run into the same situation!