# Modify arrow in label

Is it possible to change the arrowhead in a label?

In combination with the draw command it is easy to modify arrowheads:

\documentclass[a4paper, 12pt]{book}
\usepackage{fontspec}
\setmainfont{Cambria}
\setsansfont{Calibri}

\usepackage[ngerman]{babel}
\usepackage{graphicx}
\usepackage{tikz}
\usepackage{pgfplots}
\pgfplotsset{compat=1.16}
\usepackage{mathtools}

\tikzset{>=latex, % option for nice arrows
inner sep=0pt,%
outer sep=2pt,%
mark coordinate/.style={inner sep=0pt,outer sep=0pt,minimum size=3pt,
fill=black,circle}%
}

\begin{document}

\begin{tikzpicture}
\draw[->] (0,0) -- (1,0);
\end{tikzpicture}

\end{document}


I would prefer an arrow head at the xlabel and ylabel like in the example above instead of \rightarrow like in the example below:

\documentclass[a4paper, 12pt]{book}
\usepackage{fontspec}
\setmainfont{Cambria}
\setsansfont{Calibri}

\usepackage[ngerman]{babel}
\usepackage{graphicx}
\usepackage{tikz}
\usepackage{pgfplots}
\pgfplotsset{compat=1.16}
\usepackage{mathtools}

\begin{document}

\begin{tikzpicture}
\begin{axis}[domain=0:45,
/pgf/number format/1000 sep={},
samples=180,
grid=major,smooth,
xmin=0,
xmax=45,
ymin=-0.5,
ymax=0.5,
xlabel=$^{\circ} C \rightarrow$,
ylabel=$m s^{\, -2} \rightarrow$,
legend pos=north west],
\legend{$Temperature drift$}
{(-0.000003643682714*x^3+
(0.000234812441401*x^2+
(0.004932909568573*x};
\end{axis}
\end{tikzpicture}
\end{document}


Is there any way to modify the head of \rightarrow that it looks like the arrowhead in the first example?

Current legend:

Preferred legend:

• Welcome to TeX.SX!! Rather than posting code fragments it is better to give a full minimal working example. Currently we have to guess what packages etc you are using and this makes it really hard to help you. A MWE should start with a \documentclass command, have a minimal preamble and then \begin{document}...\end{document}. The code should compile and be as small as possible to demonstrate your problem. – user30471 Aug 5 '18 at 13:14

something like this:

\documentclass[a4paper, 12pt]{book}
\usepackage{fontspec}
\setmainfont{Cambria}
\setsansfont{Calibri}

\usepackage[ngerman]{babel}
\usepackage{graphicx}
\usepackage{pgfplots}
\pgfplotsset{compat=1.16}
% \usetikzlibrary{arrows.meta, calc, fadings, decorations.pathreplacing} % not needed
\usepackage{mathtools}
\usepackage{siunitx}     % new, for units

\newcommand\arr{\tikz[baseline=-0.6ex]\draw[-latex] (0,0) -- + (7mm,0);} % <--- define arrow for your axis labels

\begin{document}
\begin{tikzpicture}
\begin{axis}[domain=0:45,
/pgf/number format/use comma,
samples=180,
grid=major,smooth,
xmin=0,
xmax=45,
ymin=-0.5,
ymax=0.5,
xlabel={\si{\celsius} \arr},                 % <---
ylabel={\si{\meter\per\square\second} \arr}, % <---
legend pos=north west
]
\legend{\emph{Temperature drift}}  % <--- changed
{(-0.000003643682714*x^3+
(0.000234812441401*x^2+
(0.004932909568573*x};
\end{axis}
\end{tikzpicture}
\end{document}


edit (1): to have decimal comma instead dot you need to replace /pgf/number format/1000 sep={}, (which is actually not needed in your case) with /pgf/number format/use comma, (now consider in above mwe).

edit (2): to set decimal commas globally you is only need to move /pgf/number format/use comma, to \pgfplotsset (where you can collect all common options of yours pgfplots images):

\usepackage{pgfplots}
\pgfplotsset{compat=1.16,
/pgf/number format/use comma,   % <---
}


and than for image write:

    \begin{tikzpicture}
\begin{axis}[domain=0:45,
samples=180,
grid=major, smooth,
xmin=0,
xmax=45,
ymin=-0.5,
ymax=0.5,
xlabel={\si{\celsius} \arr},                 % <---
ylabel={\si{\meter\per\square\second} \arr}, % <---
legend pos=north west
]
\legend{\emph{Temperature drift}}  % <--- changed

• a decimal comma instead dot? i will look in pgfplots manual :-) – Zarko Aug 6 '18 at 17:49