Skip to main content

A wrapper for automating common matplotlib tasks

Project description

plit

plit is a Matplotlib wrapper that automates the undifferentiated heavy-lifting of writing boilerplate code while maintaining the power and feel of Matplotlib.

There are two components to plit:

  • Wrappers around core chart types for standard line, scatter, histograms, and bar charts.
  • Templates that are built from these primatives for specific analytic tasks.

Here is an example chart created with plit:

See the docs for more information.

Note: if you are looking for the project that manages a set of git repositories, that project has been renamed to glit (GitHub, PyPi).

Install

pip install plit

Quick Start

The best place to get started is the wrappers. There are three main wrappers included in plit. The naming is consistent with matplotlib. They work with multi-series by default.

  • plot: for line and scatter charts.
  • hist: for histograms.
  • bar: for bar charts.

Create a line chart

Create a line and scatter chart using the plot function.

import numpy as np
x = [np.arange(10)]
y = [np.random.random(size=(10,1)) for _ in range(4)]

from plit import plot

plot(x, y, list("ABCD"), 'X', 'Y');

Create a scatter chart

By simply changing the marker_type='o' you switch from line to scatter chart.

from plit import plot

x = [np.random.random(size=(10,1)) for _ in range(4)]
plot(x, y, list("ABCD"), 'X', 'Y', marker_type='o')

Create a histogram

Create a histogram using the hist function.

from plit import hist

x = [np.random.normal(size=(100,1)), np.random.gamma(shape=1, size=(100,1)) - 2]
hist(x, list("AB"), 'X', title='Histogram', bins=20)

Create a bar chart

Create a grouped bar chart with the bar function.

from plit import bar

x = [f"Group {i+1}"for i in range(6)]
y = [np.random.random(size=(6)) for _ in range(2)]
bar(x, y, list("AB"),'X', 'Y', colors=list("kb"), title='Bar Chart')

Example notebooks

The best way to go deeper is to look at the examples notebooks:

  • quick-start notebook gives an overview of core functionality including creating core chart types.
  • plit-vs-matplotlib shows the difference between matplotlib and plit with a simple example.
  • creating-templates-file demonstrates how to use partial functions to simplify and streamline your visualization workflow.
  • accuracy-vs-coverage shows an illustrative example using a template created for visualizing accuracy and coverage.
  • precision-vs-recall shows an illustrative example using a template created for choosing a threshold using precision and recall.
  • softmax-calibration shows an illustrative example using a template created for evaluating the calibration for softmax output.

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

plit-0.1.11.tar.gz (22.6 kB view details)

Uploaded Source

Built Distribution

plit-0.1.11-py3-none-any.whl (11.6 kB view details)

Uploaded Python 3

File details

Details for the file plit-0.1.11.tar.gz.

File metadata

  • Download URL: plit-0.1.11.tar.gz
  • Upload date:
  • Size: 22.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/52.0.0.post20210125 requests-toolbelt/0.9.1 tqdm/4.58.0 CPython/3.7.10

File hashes

Hashes for plit-0.1.11.tar.gz
Algorithm Hash digest
SHA256 259554b22d351a6197a56203a5b7b44e7ec592a719942bd012add1285ba8548f
MD5 d4e1dbd589de4f5f7c85b8c103ea585e
BLAKE2b-256 bdf22495f36bf0f0f3904cfcd0adb0d0da8a988324b3cd0551e14cd3a2148090

See more details on using hashes here.

File details

Details for the file plit-0.1.11-py3-none-any.whl.

File metadata

  • Download URL: plit-0.1.11-py3-none-any.whl
  • Upload date:
  • Size: 11.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/52.0.0.post20210125 requests-toolbelt/0.9.1 tqdm/4.58.0 CPython/3.7.10

File hashes

Hashes for plit-0.1.11-py3-none-any.whl
Algorithm Hash digest
SHA256 4ec4047967455c0becf46eb5c541dfd7b6c7e5b131c966a76036c305cbef6b1f
MD5 0c837e51bd537381cdba6e95ea0c28ac
BLAKE2b-256 5fd702af911cbf37d492436b0f92f7c3cc0b43420f66d4fec2bcc74070babe7a

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