Open KristofferC opened 3 years ago
Alternatively, it is already possible to do this from PGFPlotsX:
So maybe we should just add some docs on how to do this.
I think that just documenting the preamble solution would be best, as it makes the variables explicit.
Agree
A common workflow with PGFPlotsX.jl is that you export a figure .tex file (without a preamble) and then include it in a main .tex document. Often, you want to be able to set the width and height of this figure from the main .tex document. What you can do is to include the figure with
\includegraphics
and then use e.g. thewidth
option to set the width of the figure. This however leads to the drawback that the text of the figure is scaled as well, meaning it looks inconsistent with the rest of the document.The way to properly resize a figure (without scaling the text) is to set the
width
andheight
options of the axis. This is however something you do from within the exported .tex file which is a bit awkward.What other software does, for example
matlab2tikz
(https://tomlankhorst.nl/matlab-to-latex-with-matlab2tikz/) is that they allow you to set the height and width like this:The
fheight
andfwidth
are set from the main tex file and there is no need to modify the exported figure .tex file if one wants to change its size. This does not scale the figure text.Having some option of exporting a figure to support this workflow probably makes sense.