Skip to main content

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.

Source Distribution

easydarkfigs-0.11.tar.gz (3.9 kB view details)

Uploaded Source

Built Distribution

easydarkfigs-0.11-py3-none-any.whl (5.5 kB view details)

Uploaded Python 3

File details

Details for the file easydarkfigs-0.11.tar.gz.

File metadata

  • Download URL: easydarkfigs-0.11.tar.gz
  • Upload date:
  • Size: 3.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.18.4 setuptools/40.7.1 requests-toolbelt/0.8.0 tqdm/4.19.9 CPython/3.6.4

File hashes

Hashes for easydarkfigs-0.11.tar.gz
Algorithm Hash digest
SHA256 609a8b1f76090dfa30c3526a4e26a9969736df413ba9004e8a3b0a301d7575c9
MD5 0321a995ec2cce78fca5669f2024987a
BLAKE2b-256 4aa59c0054ed0a4cb102eb036374816e04b0b54a57f9a48cf32069b9ae46f16b

See more details on using hashes here.

File details

Details for the file easydarkfigs-0.11-py3-none-any.whl.

File metadata

  • Download URL: easydarkfigs-0.11-py3-none-any.whl
  • Upload date:
  • Size: 5.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.18.4 setuptools/40.7.1 requests-toolbelt/0.8.0 tqdm/4.19.9 CPython/3.6.4

File hashes

Hashes for easydarkfigs-0.11-py3-none-any.whl
Algorithm Hash digest
SHA256 47a7e7d36d195d9328a7ca5705f542d33b193dae830f238136a895a7394a6f9e
MD5 dc2837231fcc84f62e9ebb10e6330b65
BLAKE2b-256 cd9efbd51ef20f498290f00e84ab48d64c6f0d89bc0f1f212cb41bc7d3924440

See more details on using hashes here.

Supported by

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