36

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

guillem
  • 4,984
sayros
  • 2,629

3 Answers3

30

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

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

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

Joseph Wright
  • 259,911
  • 34
  • 706
  • 1,036
28

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

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

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

perror
  • 754
  • 1
  • 8
  • 21
7

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
}}

%-------------------------------------------
\begin{axis}
[
 ylabel style={yshift=0.4cm}, %shifting the y line text
]
Nivir
  • 410