Functions and shortcuts to create latex-ready images from matplotlib
Project description
matplotlib-latex-bridge
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:
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Hashes for matplotlib-latex-bridge-0.2.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7270f4c8f380a6ad30db263c98acd09cf1e86023251a365a997d714c3d54b849 |
|
MD5 | 51bcdd357e40aa3fe0eaeaff97ad3053 |
|
BLAKE2b-256 | 608166748a7796fa190f826df669f90aceab6ca308cbb6f3712e14e2bee931f2 |
Hashes for matplotlib_latex_bridge-0.2.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 56df566d18f2c874362b49d149077c52357e942ec3e38f714c90a5c327cd0a81 |
|
MD5 | 967f2d566ddefe3f75625a3d710d9ed0 |
|
BLAKE2b-256 | fc11f39eea37e3815443b0abcc8354da1d6ae0f82ef8c9eb4ac47ac7e30387e7 |
Hashes for matplotlib_latex_bridge-0.2.0-py2-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3174b107b51add37541c2f0aafd950102cec4ea8be6c242880801b10a8c550ad |
|
MD5 | 95454c300819a4b3db8966bbc046a794 |
|
BLAKE2b-256 | 7b7eae00243eacf16f18c5b5dddf7c8877b50ed8635a74d2ca47c4176681ff56 |