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 would like to add a label to the axes of my plot. This is my code:

      % Lengend position
      legend pos = outer north east,
      % We need a tick for every data
      xtick = data,
      % The ticks label are provided in the file as the column named Num
      xticklabels from table = {test.dat}{Num}]
    % How the data are separated.
   % \pgfplotstableset{col sep = tab}
    % We need to simulate an x coord since it is litteral in the data file. I choose to index on the line.
    \addplot table [x expr = \lineno, y = Min] {test.dat};
    \addplot table [x expr = \lineno, y = Moy] {test.dat};
    \addplot table [x expr = \lineno, y = Max] {test.dat};

\caption{Propagation d'une publication générée avec la politique est \bf {Amis Seulement}}
share|improve this question
The keys for adding labels to the axes are xlabel and ylabel. It's not too hard to find this in the manual. – Jake May 10 '12 at 11:38
The tag is pgfplots – Alain Matthes May 10 '12 at 11:45

you might do either:

  1. use xlabel and ylabel in the options part of the axis environment
  2. use \node at (axis cs:xmax,0) {your_x_label_here} and \node at (axis cs:0,ymax) {your_y_label_here}

according to me, second way is easier when you need a more accurate label location by ajusting node options...

share|improve this answer
Your second approach only works if you set clip=false or use the \node command in the after end axis/.code={...}. A better way might be to use xlabel to set the label, and adjust the position using xlabel style={at=(current axis.right of origin)} or xlabel style={at=(axis cs:<x>,<y>)} – Jake May 11 '12 at 10:07

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.