Open qwenger opened 2 years ago
Note: I could generate plot.tex
to the top-level directory, but that's seems less logical conceptually, plus it's less convenient e.g. for VCS integration.
A couple independent ideas in case tikzplotlib
has to be modified for this:
\pgfimage
vs \includegraphics
accessible by a parametertex_relative_path_to_data
in the generated *.tex
(but that's not robust to moving generated files around)\CurrentFilePath
and friendsgraphics/search path
feature by PGF\pgfimage
respects \graphicspath
by PGF or graphicxtikzplotlib.save
I have the following structure:
main.tex
:Makefile
:plot.py
:generated
plot.tex
:I would like generated
*.tex
files to be stored inimages/
together with their*.png
companions.However, if I do so (with the
images/
prefix intikzplotlib.save
), when compilingmain.tex
I get:because in
plot.tex
the*.png
is included without path.tex_relative_path_to_data="images/"
totikzplotlib.save
does not work, I get the error\graphicspath{{images/}}
tomain.tex
does not work, because for some reasontikzplotlib
forces theincludegraphics cmd
to\pgfimage
(which does not seem to respect\graphicspath
) rather than\includegraphics
.table/search path
in PGF for\addplot table
, but there doesn't seem to be an equivalent for\addplot graphics
.tex_relative_path_to_data=os.path.abspath("images/")
intikzplotlib.save
, but that's ugly and non-portable.Is there a good way to make this work?