TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

enter image description here


    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); 


share|improve this question
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
up vote 4 down vote accepted

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.

share|improve this answer
How do you check what version you have? – Magpie Mar 9 '13 at 22:16
It's listed in the .log file that is generated when you compile your document. – Jake Mar 9 '13 at 22:21
Thanks for your help @jake I have added some other stuff to elaborate on some additional axis formatting problems. I can verify that your solution did work on my question before I edited. If mods want me to accept this and start a new questin with additional queries I am happy to do so though. – Magpie Mar 12 '13 at 10:17

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.