Skip to main content

A Python package for data visualization styles and plots used at https://jota.info

Project description

JOTA VIZ STYLES

Matplotlib JOTA style for making figures This repo has Matplotlib JOTA style to format plots and figures for publications and presentation.

Getting Started

The easist way to install jotaviz is to use pip:

# to install the latest release (from PyPI) 
pip install jotaviz

# in Ubuntu/Debian
python3 -m pip install jotaviz

# to install latest commit (from GitHub)
pip install git+https://github.com/JOTAJornalismo/jotaviz.git

# to clone and install from a local copy
git clone https://github.com/JOTAJornalismo/jotaviz.git
cd jotaviz
pip install -e .

The pip installation will automatically move all of the Matplotlib style files *.mplstyle into the appropriate directory on your computer.

Please see the FAQ section for more information and troubleshooting.

Using the Style

"extensys" is the main style from this repo. Whenever you want to use it, simply add the following to the top of your python script:

import matplotlib.pyplot as plt
plt.style.use('jotaviz')

Available styles include:

jotaviz, jotaviz-black, jotaviz-white, jotaviz-glass

To use any of the styles temporarily, you can use:

with plt.style.context(['jotaviz']):
    plt.figure()
    plt.plot(x, y)
    plt.show()

The default format to save figure is .png with dpi=500. Other formats by obtained by passing it in the plt.savefig as well as the dpi. For example:

plt.savefig("figures/fig1" + ".pdf", dpi=1000)

Examples

The jotaviz style:

The jotaviz-white style (with markers)

The jotaviz-black style (with grid)

The extensys + dark_background style

Custom plots

Help and contribution

Please feel free to contribute to the jotaviz repo! Before starting a new style or making any changes, please create an issue through the GitHub issue tracker.

If you need any help with jotaviz, please first check the FAQ and search through the previous GitHub issues. If you can't find an answer, create a new issue through the GitHub issue tracker.

You can checkout Matplotlib's documentation for more information on plotting settings.

Citation

You don't have to cite jotaviz if you use it but it's nice if you do:

@article{jotaviz,
    author    = {Daniel Marcelino},
    title     = {{JOTAJornalismo/jotaviz}},
    month     = {nov},
    year      = {2021},
    publisher = {},
    version   = {},
    doi       = {},
    url       = {}
}

License

MIT

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

jotaviz-1.4.0.tar.gz (28.2 kB view hashes)

Uploaded Source

Built Distribution

jotaviz-1.4.0-py3-none-any.whl (29.1 kB view hashes)

Uploaded Python 3

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