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.9.tar.gz (3.9 kB view details)

Uploaded Source

Built Distribution

easydarkfigs-0.9-py3-none-any.whl (5.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: easydarkfigs-0.9.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.9.tar.gz
Algorithm Hash digest
SHA256 f25b8a02cd5e64a3f1e16f03437d19383c73c10002e6e72b4f02ccff965edb6a
MD5 68ea59c1580a9ef36c556d35db76e693
BLAKE2b-256 1bf29cd3518c99067554ee748ff7e4456b5fa597022b73d70334f27b131aee56

See more details on using hashes here.

File details

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

File metadata

  • Download URL: easydarkfigs-0.9-py3-none-any.whl
  • Upload date:
  • Size: 5.2 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.9-py3-none-any.whl
Algorithm Hash digest
SHA256 3423934569372a320eff55682afdc2a1c2688d1d96ac1057efae51bffa4d878b
MD5 7661af1efd413349384a5692dbef9570
BLAKE2b-256 f340d8127660362348aba63eea99e6f5fc2846271d7f57ef0ad6cfbc4bf307ed

See more details on using hashes here.

Supported by

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