Convert matplotlib figures to TikZ/PGFplots code for seamless integration into LaTeX documents.
tikzplotlib is a Python library that converts matplotlib figures into PGFPlots (TikZ) code for direct use in LaTeX documents. It solves the problem of integrating Python-generated plots into LaTeX while preserving editability and consistency with document styling. The tool outputs clean TeX code that describes graphs in terms of axes, data, and styles rather than low-level drawing commands.
Researchers, academics, and scientists who use Python for data analysis and matplotlib for visualization, and who need to include publication-quality plots in LaTeX documents such as papers, theses, or reports.
Developers choose tikzplotlib because it produces more semantic and editable PGFPlots code compared to matplotlib's raw TikZ backend, enabling easier customization within the TeX workflow. It maintains the visual fidelity of matplotlib plots while leveraging LaTeX's superior typesetting for text and math.
:bar_chart: Save matplotlib figures as TikZ/PGFplots for smooth integration into LaTeX.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Generates code that describes plots in terms of axes and data, making it more understandable and editable than raw TikZ, as the README emphasizes for enhanced editability.
Designed for native inclusion in LaTeX or ConTeXt documents with preamble generation, fitting into existing workflows and allowing plot tweaking as part of document preparation.
Includes clean_figure command to remove out-of-bounds points, simplify curves, and reduce point density for target resolution, optimizing output for better performance and clarity.
Retains more information from matplotlib, such as plot styles and labels, enabling straightforward customization within TeX, unlike low-level alternatives.
Explicitly stated in the README that 3D plots don't work, limiting usability for scientific visualizations that require three-dimensional representations.
Requires PGFPlots and related TeX packages installed and configured, adding setup overhead compared to standard image exports, which can be a barrier for users new to LaTeX.
Not all matplotlib figures convert error-free; complex or unsupported plot types may need manual adjustments, as noted in the documentation about potential conversion issues.
The clean_figure optimization and code generation can be slow for large or intricate plots, impacting workflow efficiency, especially in automated pipelines.