iPython Magic for Easy Dark/Light Figures
Project description
easydarkfigs - iPython Magic for easy Dark/Light Matplotlib figures
Installation
easydarkfigs
can be installed through pip via
pip install easydarkfigs
Usage
Within an active iPython or Jupyter environment:
import easydarkfigs
Then, at the beginning of a cell where a Matplotlib figure is created:
%%savefig_dark_light figname.ext # Code # to # create # figure
This will save two versions of the created figure, using the easy-dark
and easy-light
Matplotlib style files
included with this package.
To customize these default styles, edit them in your matplotlib directory.
To change the default figure save location or styles to use:
%set_darkstyle new-style %set_darkfigdir my/dir/ %set_lightstyle new-style %set_lightfigdir my/dir/
The code also makes a boolean variable is_dark
available during execution, the value of which changes depending on which version of the plot is being created.
%%savefig_dark_light figname.ext if is_dark: title = 'This Is A Dark Plot' else: title = 'This Is A Light Plot' plt.title(title)
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Filename, size | File type | Python version | Upload date | Hashes |
---|---|---|---|---|
Filename, size easydarkfigs-0.11-py3-none-any.whl (5.5 kB) | File type Wheel | Python version py3 | Upload date | Hashes View |
Filename, size easydarkfigs-0.11.tar.gz (3.9 kB) | File type Source | Python version None | Upload date | Hashes View |
Hashes for easydarkfigs-0.11-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 47a7e7d36d195d9328a7ca5705f542d33b193dae830f238136a895a7394a6f9e |
|
MD5 | dc2837231fcc84f62e9ebb10e6330b65 |
|
BLAKE2-256 | cd9efbd51ef20f498290f00e84ab48d64c6f0d89bc0f1f212cb41bc7d3924440 |