I'm trying to plot a diagram with matplotlib and embed it in latex. I want the diagram to have the full textwidth so I printed the textwidth in points to my document with \the\textwidth. The value I've got is 418.25555pt. However when I convert this value to inches with google for instance I get: 5.80910486111. This, however, is based on the assumption that one inch equals 72 pt. This is different from the information given here: https://en.wikibooks.org/wiki/LaTeX/Lengths
It says 1 inch equals 72.27 pt. I wrote a helper function in python to convert points to inches:
import scipy.constants as sc
def figsize(scale, textwidthInPt):
textwidthInInch = textwidthInPt * sc.pt / sc.inch #1
figWidthInInch = textwidthInInch * scale
figHeightInInch = figWidthInInch / sc.golden_ratio
return [figWidthInInch, figHeightInInch]
The line marked with #1 shows the conversion to inch. The constants from scipy are also based on the 1 in = 72 pt equality.
All my plots are slightly to wide and cause an overfull hbox warning.
Why is LaTeX different in this case?
\documentclassand ending with\end{document}. – Bobyandbob Apr 27 '17 at 13:22bp, and traditional printer's pointspt, defined as72.27 pt = 72 bp = 1in. – Thruston Apr 27 '17 at 13:31tight_layout()on your figures in matplotlib for the inclusion in LaTeX (just a tip). – Skillmon Apr 27 '17 at 13:33