Sub-issue of #50.
Problem
Matplotlib delivers display coordinates (points / pixels). TikZ works
natively in cm. Without a conversion factor, a typical 6×4 in figure
explodes into a 15+ cm picture that breaks page layout in textbooks and
slide templates.
Proposed fix
Expose scale as a constructor argument on TikzRenderer (default 0.5,
cm per display unit after Matplotlib's internal DPI) and surface an
override at the Canvas.save(..., tikz_scale=...) layer.
Optionally derive a default from fig.get_size_inches() so a 6×4 in
figure maps to a reasonable ~7.5×5 cm TikZ picture without manual tuning.
Acceptance criteria
Sub-issue of #50.
Problem
Matplotlib delivers display coordinates (points / pixels). TikZ works
natively in
cm. Without a conversion factor, a typical 6×4 in figureexplodes into a 15+ cm picture that breaks page layout in textbooks and
slide templates.
Proposed fix
Expose
scaleas a constructor argument onTikzRenderer(default0.5,cm per display unit after Matplotlib's internal DPI) and surface an
override at the
Canvas.save(..., tikz_scale=...)layer.Optionally derive a default from
fig.get_size_inches()so a 6×4 infigure maps to a reasonable ~7.5×5 cm TikZ picture without manual tuning.
Acceptance criteria
TikzRenderer(..., scale=s)multiplies every emitted coordinate bys.Canvas.save('plot.tex', tikz_scale=0.4)propagates cleanly.(e.g. ≤ 10 cm wide) by default.
Canvas.saveoptions.