# How can I fix the formatting of my axis using pgfplots so the axis titles aren't on top of the numbers?

How can I offset my ylabel so it doesn't smudge with the numbers?

code

\begin{figure}[H]
\centering
\begin{tikzpicture}
\begin{axis}[
scale=1.8,
xmin=-15,xmax=15,xlabel={Current $mA$}, ylabel={Residuals $mV$}
]
\addplot [only marks, black, error bars/.cd, y dir=both, x dir=both, y explicit, x explicit, error bar style={color=mapped color}]
table[x=Residuals,y=Voltage,x error=xerr,y error=yerr]{sfnErr.dat}; % plot the data
\draw[ultra thin,gray] (axis cs:\pgfkeysvalueof{/pgfplots/xmin},0) -- (axis cs:\pgfkeysvalueof{/pgfplots/xmax},0);

\end{axis}
\end{tikzpicture}

\caption{*}
\end{figure}

-
Use some thing like: \pgfplotsset{every axis y label/.append style={xshift=1.5em} } Adjust the distance as suitable. –  Harish Kumar Jan 31 '13 at 0:56
Where to put it? In the preamble? –  Magpie Jan 31 '13 at 1:00
If you want it for all graphs, put it in the preamble. If only for one graph, put it as an option to your \begin{axis}[every axis y label/.append style={xshift=1.5em}] –  Harish Kumar Jan 31 '13 at 1:04
It would be easier to help if you provide an MWE and your or a portion of your sfnErr.dat. –  hpesoj626 Jan 31 '13 at 1:16
@jake yes I agree. Too many people edit questions and forget about the title. It's why I can never find things. I will make this a new question. –  Magpie Mar 12 '13 at 10:49

If you insert \pgfplotsset{compat=1.7} (or whatever your PGFPlots version number is, as long as it's newer than 1.3) into your preamble, the axis labels will be placed dynamically, taking into account the width of the tick labels.
It's listed in the .log file that is generated when you compile your document. –  Jake Mar 9 '13 at 22:21