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

What is the default distance between the axis numbers and axis labels in the plots made with pgfplots?enter image description here

share|improve this question
up vote 4 down vote accepted

The default distance between the tick labels and the axis labels when using compat=1.3 or later (and thus xlabel near ticks) is 2*inner sep + 2*outer sep = 2*0.3333em + 2*0.5\pgflinewidth.

If you're not using compat=1.3 (or explicitly supply xlabel absolute), the distance between the top of the x label and the x axis is 15pt, and the distance between the horizontal centre of the y label and the y axis is 35pt.

share|improve this answer
+1: how did you find this out? studying the source? – cmhughes Jun 4 '12 at 16:56
ok ! thanks how i can set up this distance: "2*inner sep + 2*outer sep = 2*0.3333em + 2*0.5\pgflinewidth" i use compat=newest – FormlessCloud Jun 4 '12 at 17:16
@FormlessCloud: The distance is set up automatically when you use compat=newest. – Jake Jun 4 '12 at 17:17
even if I manually changed the distance from the grid of the tick labels with this command: yticklabel shift = 2pt xticklabel shift = 2pt ? – FormlessCloud Jun 4 '12 at 17:21
@FormlessCloud: Yes, if you use compat=newest and you have a version of PGFplots >= 1.3 then the distance between the tick labels and the axis labels will be kept automatically. – Jake Jun 4 '12 at 17:27

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.