I made a coordinate system with pgfplots. Now I want the font to be in sans serif, so I tried the command \sffamily
after document start (just like in the example). With this everything is in sans serif but the y-axis labels. I tried \begin{tikzpicture}[font=\sffamily]
as well as \pgfplotsset{ticklabel style = {font=\sffamily},
y axis label/.append style={font=\sffamily},
}
but all of this comes to the same result shown underneath the code.
Does anybody know how to get the font of the y axis in sans serif, too?
\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{pgfplots}
\begin{document}
\sffamily
\begin{tikzpicture}
\begin{axis}[
width=14cm,
height=7cm,
scale only axis,
xmin=-5,xmax=105,
ymin=0,ymax=12,
x dir=reverse,
axis y line*=right,
axis x line*=top,
xtick=\empty,
extra x ticks={0,10,20,30,40,50,60,70,80,90,100},
extra x tick labels={{0},{10},{20},{30},{40},{50},{60},{70},{80},{90},{100}},
every x tick/.style={},
xlabel=Palmfett / Gew.\%,
xlabel style={at={(0.5,1.225)}},
]
\end{axis}
\begin{axis}[
width=14cm,
height=7cm,
scale only axis,
xmin=-5 ,xmax=105,
ymin=0, ymax=12,
axis y line*=left,
axis x line*=bottom,
xtick=\empty,
extra x ticks={0,10,20,30,40,50,60,70,80,90,100},
extra x tick labels={{0},{10},{20},{30},{40},{50},{60},{70},{80},{90},{100}},
extra x tick style={grid=major},
every x tick/.style={},
xlabel=Bienenwachs / Gew.\%,
ylabel=Martenshärte / N/mm$^2$
]
\end{axis}
\end{tikzpicture}
\end{document}