Consider the following MWE: I find it amusing that the second tikzpicture cannot compile without the first, even though the second value for (A) is the one being used. Can anyone explaing this?
In my real example I have a a function plot from which I store some coordinates. Later on I need to add some extra drawings at these named points.
Are there any way of doing this other than delaying the scope I use to place things until after \end{axis}?
\documentclass{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat=1.13}
\begin{document}
\begin{tikzpicture}
% remove this and the second tikzpicture does not compile
\coordinate (A) at (0,0);
\end{tikzpicture}
\begin{tikzpicture}
\begin{axis}[
xmax=3,xmin=0,ymax=3,ymin=0
]
\draw (axis cs: 0,0) -- (axis cs:3,3)
coordinate [pos=0.4] (A)
;
\fill (A) circle (2pt);
% more this scope until after \end{axis} and we do not need
% to have (A) defined in another image
\begin{scope}[
shift={(A)},
]
\draw (0,0) circle (1cm);
\end{scope}
\end{axis}
\end{tikzpicture}
\end{document}
\pgfplotsextra{...}– percusse May 03 '16 at 13:31\tikzstylesuch that common options toaxiscan be collected into one style? – daleif May 03 '16 at 13:43\pgfplotstyle{every axis={...}}and related ones are in the manual. Note that it's notevery axis/.stylebut only the key. More is given in the manual for post processing etc. – percusse May 03 '16 at 13:50stylewithpgfplotsset, see http://tex.stackexchange.com/a/139084/38080 --- @percusse, I'd like to see an answer on this, I never heard about\pgfplotsextra{}too.... – Rmano May 03 '16 at 13:51pgfplotsset– percusse May 03 '16 at 14:02clip mode=individual? http://tex.stackexchange.com/questions/301585/axis-label-positioning-in-pgfplots – Rmano May 03 '16 at 14:09