Skip to main content

Functions and shortcuts to create latex-ready images from matplotlib

Project description

matplotlib-latex-bridge

Documentation Status

This library provides a set of functions and shortcuts to create latex-ready images with matplotlib.

This library is not a replacement for matplotlib, it can just be used to set sensible settings in order to have figures with readable text and with a font size that is consistent both among various figures and with the rest of the text in the document.

Example:

example

Install

The latest stable version can be installed via pip:

pip install matplotlib-latex-bridge

Otherwise, the library can be installed from sources:

git clone https://github.com/loreucci/matplotlib-latex-bridge.git
cd matplotlib-latex-bridge
pip install -e .

Quickstart

Initialize the library using one of the presets provided:

import matplotlib_latex_bridge as mlb

mlb.setup_page(**mlb.formats.article_letterpaper_10pt_singlecolumn)

Create a new figure and use it as normal:

mlb.figure_textwidth()  # for full page images
mlb.figure_columnwidth()  # for full column images

plt.plot(...)  # use matplotlib as normal

fig.savefig("image.png")

Include it in the latex file without scaling:

\begin{figure}
    \centering
    \includegraphics[scale=1]{image.png}
\end{figure}

That's it!

For more options please refer to the online documentation.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

matplotlib-latex-bridge-0.2.0.tar.gz (18.4 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

matplotlib_latex_bridge-0.2.0-py3-none-any.whl (18.6 kB view details)

Uploaded Python 3

matplotlib_latex_bridge-0.2.0-py2-none-any.whl (18.6 kB view details)

Uploaded Python 2

File details

Details for the file matplotlib-latex-bridge-0.2.0.tar.gz.

File metadata

  • Download URL: matplotlib-latex-bridge-0.2.0.tar.gz
  • Upload date:
  • Size: 18.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.5.0 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.1

File hashes

Hashes for matplotlib-latex-bridge-0.2.0.tar.gz
Algorithm Hash digest
SHA256 7270f4c8f380a6ad30db263c98acd09cf1e86023251a365a997d714c3d54b849
MD5 51bcdd357e40aa3fe0eaeaff97ad3053
BLAKE2b-256 608166748a7796fa190f826df669f90aceab6ca308cbb6f3712e14e2bee931f2

See more details on using hashes here.

File details

Details for the file matplotlib_latex_bridge-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: matplotlib_latex_bridge-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 18.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.5.0 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.1

File hashes

Hashes for matplotlib_latex_bridge-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 56df566d18f2c874362b49d149077c52357e942ec3e38f714c90a5c327cd0a81
MD5 967f2d566ddefe3f75625a3d710d9ed0
BLAKE2b-256 fc11f39eea37e3815443b0abcc8354da1d6ae0f82ef8c9eb4ac47ac7e30387e7

See more details on using hashes here.

File details

Details for the file matplotlib_latex_bridge-0.2.0-py2-none-any.whl.

File metadata

  • Download URL: matplotlib_latex_bridge-0.2.0-py2-none-any.whl
  • Upload date:
  • Size: 18.6 kB
  • Tags: Python 2
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.5.0 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.1

File hashes

Hashes for matplotlib_latex_bridge-0.2.0-py2-none-any.whl
Algorithm Hash digest
SHA256 3174b107b51add37541c2f0aafd950102cec4ea8be6c242880801b10a8c550ad
MD5 95454c300819a4b3db8966bbc046a794
BLAKE2b-256 7b7eae00243eacf16f18c5b5dddf7c8877b50ed8635a74d2ca47c4176681ff56

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page