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

I want to change place of ylabel near the axes.enter image description here

share|improve this question

See the ylabel shift option, which can be used to move the label by an amount, for example

\begin{axis}[ylabel shift = 1 pt]

(You will need to have \pgfplotsset{compat = 1.3} or a higher version number for this to work.)

share|improve this answer
Shouldn't also be set \pgfplotsset{compat=1.3}? – Claudio Fiandrino May 4 '12 at 7:30
@Claudio I've added that comment. I always use the latest settings, so this is not something I have to worry about normally. – Joseph Wright May 4 '12 at 7:31
thanks for the explanation. I did not know this fact :) – Claudio Fiandrino May 4 '12 at 7:34
Setting \pgfplotsset{compat=1.3} (or higher) will automatically move the label "as close as possible" (i.e. near the boundary of the largest tick label). Perhaps you do not even need a custom shift (although it might be necessary if tick labels have signs which increase the bounding box). – Christian Feuersänger May 4 '12 at 19:43

Try to add the ylabel near ticks option in the axis environment like this

\begin{axis}[..., ylabel near ticks, ...]

There is no need to give a value for this option.

share|improve this answer
Welcome to TeX.sx! – Peter Jansson May 7 '13 at 16:52
The previous answer did not solve the problem, but the ylabel near ticks did. – perror May 7 '13 at 18:08

The following code shall works for you

\pgfplotsset{every axis legend/.style={
cells={anchor=center},% Centered entries
inner xsep=3pt,
inner ysep=2pt,
nodes={inner sep=2pt,text depth=0.15em},
anchor=south east,
shape=rectangle, %box shape
fill=white, %box inside
draw=white, %box color
at={(rel axis cs:0.90,1.0)} %box position right top

 ylabel style={yshift=0.4cm}, %shifting the y line text
share|improve this answer

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.