[Tex/LaTex] Default values of axes width and height of plots with pgfplots

pgfplotstikz-pgf

How does pgfplots determine the default size (width and height) of a plot particularly the box defined by axes?

I have checked one of the plots that I generated with default values of pgfplots using trial-and-error and draw the line:

\draw (0,0) -- (6.86,5.69);

It seems like, the inner box is approximately 6.86cm by 5.69cm. Or 194.457pt by 161.291pt.

enter image description here

Best Answer

As you can read in the PGFPlots Manual, Section 4.10.1, page 292 (v1.15)

  • the default width is set by \axisdefaultwidth macro, and it is preset to 240pt
  • the default height is set by \axisdefaultheight macro, and it is preset to 207pt

Also, tick labels, axis labels and the title has a fixed dimension of 45pt. See PGFPlots Manual, Section 4.10.1, page 291 (v1.15).

This means that the box itself would have dimensions of 195pt and 162pt, which is very near the values that you measured yourself.