# pgfplots “every quiver plot” style key?

I would like to add the same set of options to every pgfplots “quiver plot”. PGFPlots provides style like every axis plot to add to every plot, but quiver plots are created inside a quiver={...} scope.

The obvious guess was to set a style key called every quiver plot but it doesn't have any effect. Adding quiver keys to every axis plot results in an error.

Here is a minimal non-working example.

\documentclass{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat=1.10}
\pgfplotsset{
every axis/.append style={
xmin=-1,xmax=1,ymin=-1,ymax=1,
view={0}{90},
width=4cm,
axis equal image
},
every axis plot/.append style={
blue,-stealth,
},
% compiles without error but has no effect
every quiver plot/.style={
scale arrows=0.5,
update limits
}
}
\begin{document}
\begin{tikzpicture}
\begin{axis}
\end{axis}
\end{tikzpicture}
\begin{tikzpicture}
\begin{axis}
\end{axis}
\end{tikzpicture}
\end{document}


As soon as I posted it I found a workaround:

\documentclass[png]{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat=1.10}
\pgfplotsset{
every axis/.append style={
xmin=-1,xmax=1,ymin=-1,ymax=1,
view={0}{90},
width=4cm,
axis equal image
},
every axis plot/.append style={
blue,-stealth,
quiver={scale arrows=0.5,update limits}
}
}
\begin{document}
\begin{tikzpicture}
\begin{axis}
\end{axis}
\end{tikzpicture}
\begin{tikzpicture}
\begin{axis}
\end{axis}
\end{tikzpicture}
\end{document}


For some reason I thought that setting quiver keys in the plots would override those set in every axis plot. Luckily, I was mistaken.

To achieve the interface I was looking for (i.e., an actual every quiver plot style), you can do it this way:

\pgfplotsset{
every quiver plot/.style={},
quiver/.prefix code={\pgfqkeys{/pgfplots/quiver}{/pgfplots/every quiver plot}}
}


Then later:

\pgfplotsset{every quiver plot/.style={
scale arrows=0.5,
update limits
}}