tikzplotlib is a Python tool that converts matplotlib figures into TikZ/PGFPlots code, enabling LaTeX-friendly vector graphics. Current version 0.10.1, requires Python >=3.7. Released irregularly.
pip install tikzplotlibVerified import paths — ran on the pinned version, not inferred.
Convert a matplotlib figure to a TikZ file using tikzplotlib.save().
Assign the return value or check if None when providing a filename. Use 'return_str=False' to suppress string output.
Replace 'from tikzplotlib.save import ...' with 'import tikzplotlib' and call 'tikzplotlib.save(...)'.
Always call plt.show() or ensure the figure is properly closed before saving, or use tikzplotlib with 'plt.gcf()'.