Easy publication-ready matplotlib plots for ML papers and posters.
Project description
Agustinus' Very Opiniated Publication-Ready Plotting Library
I love TikZ. I love tikzplotlib. I've been an advocate for the latter (proof). However, tikzplotlib is as good as dead. I need to move on.
[!IMPORTANT] Here's what I use now for all my publication needs. This library is designed to be very opiniated. Beauty is in the eye of the beholder. Also, it is very simple, just a single file and that's it.
[!NOTE] Of course I still use TikZ whenever possible (e.g. Fig. 1 in a paper, diagrams, etc.)
Installation
Still with me? Still want to use this library? Here's how:
pip install pub-ready-plots
Usage
rc_params, fig_width_in, fig_height_in = pub_ready_plots.get_mpl_rcParams(
width=1, # between 0 and 1
height=0.1, # between 0 and 1
layout="icml" # or "iclr", "neurips", "poster-portrait", "poster-landscape"
)
plt.rcParams.update(rc_params)
fig, axs = plt.subplots(
nrows,
ncols,
constrained_layout=True, # Important!
)
fig.set_size_inches(fig_width_in, fig_height_in)
# Your plot here!
plt.savefig("filename.pdf")
Then in your LaTeX file, include the plot as follows:
\includegraphics[width=\linewidth]{filename.pdf}
The argument width=\linewidth
is important!
[!TIP] That's it!
Using your own styles
Two options:
- For this repo and modify things as you wish.
- Use this library and update the resulting
rc_params
dict with your styles.
Other libraries
Check out tueplots if you want a more complex library. My library is designed to achieve what I want in publication-ready papers and posters, with as little code as possible (minimalism FTW!).
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
Built Distribution
File details
Details for the file pub_ready_plots-0.1.0.tar.gz
.
File metadata
- Download URL: pub_ready_plots-0.1.0.tar.gz
- Upload date:
- Size: 3.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: pdm/2.15.4 CPython/3.12.3 Darwin/23.4.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 531ecea0e4dfcaed0fa9411ee9734c83b52a15c6821146ed011f7457310ff19c |
|
MD5 | 1c9d6384c139a730c3d5cc7acd9ccbc8 |
|
BLAKE2b-256 | cb115da31184378a149788f19264b063e1659b8fde7686d5c27f7d2d9403983a |
File details
Details for the file pub_ready_plots-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: pub_ready_plots-0.1.0-py3-none-any.whl
- Upload date:
- Size: 4.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: pdm/2.15.4 CPython/3.12.3 Darwin/23.4.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e7f9baaca9f852605d5ea2fb812ed87ce6299e6b1486b68831551cf14c692c21 |
|
MD5 | bbc724a030e0f82d8dad1553bb6c86b1 |
|
BLAKE2b-256 | b7ce3c48d262ac4926b53770e159f080bb01a6dedb16be8d7c63f795d5c39e7e |