https://github.com/ap--/properfigsize
proper figure sizes with matplotlib and pdflatex
https://github.com/ap--/properfigsize
Last synced: about 2 months ago
JSON representation
proper figure sizes with matplotlib and pdflatex
- Host: GitHub
- URL: https://github.com/ap--/properfigsize
- Owner: ap--
- License: mit
- Created: 2016-05-26T13:01:29.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2016-05-26T13:03:16.000Z (about 10 years ago)
- Last Synced: 2026-01-02T06:12:25.023Z (5 months ago)
- Language: Python
- Size: 2.93 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# properfigsize
Use the proper figure size for your matplotlib plots that you embed in a PDF with pdflatex.
Finally no more stupid font size scaling after you created all your plots and compile you PDF.
## Usage
Look at the example in the examples folder. Let's say you want to create a PDF with 2 plots.
One of them is going to be one column wide in your two column document, the other plot will
be two columns wide. You know the aspect ratios your plots should have, but not the final
sizes in your document. With **properfigsize** you can use a placeholder figsize which will
be set to the correct size, after running your plotting script twice. It's important that
you use `tight_layout=True` when creating your matplotlib figure.
## Installation
```
pip install git+https://github.com/ap--/properfigsize.git
```
## Run the example
You need pdflatex and matplotlib. To see the resulting document.pdf file, run:
```
python example.py # first pass
python example.py # second pass, figures now have the correct size
pdflatex document.tex
```