Skip to content

Generate beautiful plots for LaTeX using your existing matplotlib-based code.

License

Notifications You must be signed in to change notification settings

Steve-Hawk/latexipy

 
 

Repository files navigation

LaTeXiPy

PyPI version Test status Documentation Status Updates MIT License

Generate beautiful plots for LaTeX using your existing Matplotlib-based code.

You can also use this package to generate plots without using LaTeX. Just don't run lp.latexify().

Usage

To plot in Python:

import latexipy as lp

lp.latexify()  # Change to a serif font that fits with most LaTeX.

with lp.figure('filename'):  # saves in img/ by default.
    draw_the_plot()

https://github.com/masasin/latexipy/raw/master/examples/img/sincos_defaults.png

To display in LaTeX:

\usepackage{pgf}
\input{filename.pgf}

See the examples directory for some example code, their resulting images, as well as an example LaTeX file and its output PDF.

Features

  • Automatically generate multiple plot types, such as PDF, PNG, and PGF for LaTeX.
  • Works with all Matplotlib-based packages, including Seaborn and Pandas.
  • Allows for easily changing the style temporarily.

Credits

This package was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.

About

Generate beautiful plots for LaTeX using your existing matplotlib-based code.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 92.2%
  • Makefile 7.8%