In my document, I want all labels in tikz and pgfplots graphics to use sans-serif, so I use \tikzset{every node/.append style={font=\sffamily}}
. This works. However, when I use this, inside my axis environment, legend style={font=\tiny}
no longer has any effect. The document below produces an axis where the legend has the normal font size. How do I set all nodes to use sans-serif fonts, while still being able to tweak the font size for legends on a per-case basis?
\documentclass[tikz]{standalone}
\usepackage{tikz}
\usepackage{pgfplots}
\tikzset{
every node/.append style={font=\sffamily}}
\begin{document}
\begin{tikzpicture}%
\begin{axis}[
legend style={font=\tiny}]
\addplot coordinates {(0,0) (1,1) (2,1) (3.5, -1)};
\addlegendentry{Test}
\end{axis}%
\end{tikzpicture}%
\end{document}
True effect (sans-serif fonts, but instruction on legend font size ineffective):
Effect with the font=\sffamily
instruction disabled (serif fonts with tiny legend font size):