gpplot
Introduction
Plotting functions for the Genetic Perturbation Platform’s R&D group at the Broad Institute. Extends matplotlib and seaborn functionality with extra plot types. Includes functions for easy styling and consistent color palettes.
Free software: MIT license
Documentation: https://gpplot.readthedocs.io.
Tutorial
To install gpplot, run this command in your terminal:
$ pip install gpplot
Import packages:
import seaborn as sns import pandas as pd import numpy as np import matplotlib.pyplot as plt import gpplot
Set aesthetics for all plots using gpplot defaults:
gpplot.set_aesthetics()
Setup data:
nsamps = 20000
scatter_data = pd.DataFrame({'x': np.random.normal(size = nsamps)}, index = range(nsamps))
scatter_data['y'] = 2*scatter_data['x'] + np.random.normal(size = nsamps)
Create a point density plot and add a pearson correlation:
fig, ax = plt.subplots(figsize = (4,4)) ax = gpplot.point_densityplot(scatter_data, 'x', 'y', palette=gpplot.sequential_cmap()) ax = gpplot.add_correlation(scatter_data, 'x', 'y')
Label points in a scatterplot:
fig, ax = plt.subplots(figsize = (4,4))
mpg = sns.load_dataset('mpg')
ax = sns.scatterplot(data = mpg, x = 'weight', y = 'mpg', ax = ax)
label = ['hi 1200d', 'ford f250', 'chevy c20', 'oldsmobile omega']
gpplot.label_points(mpg, 'weight', 'mpg', label, 'name',
size = 12, style = 'italic')
TODO
Credits
This package was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.
History
0.1.0 (2020-06-16)
Project start
0.2.1 (2020-06-20)
First release on pypi
0.2.2 (2020-06-25)
Automatic integration with pypi
0.3.1 (2020-07-12)
Add plt.gca to add_correlation and label_points
Update docs to include notebook references
0.3.2 (2020-07-12)
Added minimum version for requirements
0.3.3 (2020-07-12)
Added version for dev requirements
0.3.4 (2020-07-12)
Added python version >= 3.6
0.3.5 (2020-07-22)
Updated for Matplotlib >= 3.3
0.4.0 (2020-08-18)
Added add_reg_line and add_xy_line
Metadata
Release files for gpplot 0.5.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| gpplot-0.5.0.tar.gz | 71.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| gpplot-0.5.0-py2.py3-none-any.whl | Python 2, Python 3 | none | any | Details |
Total release size: 81.2 kB
Release files / gpplot-0.5.0.tar.gz
| Download URL | gpplot-0.5.0.tar.gz |
|---|---|
| Size | 71.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
680ac856922012e3ff1a41d079624b07c9d8fa18325bbe7e44481d2ca5e89cac
|
|
BLAKE2b-256 checksum How to use checksums |
5e7019af2a7d7b5e0ba9e0f9fc15074d8eac948361842913818264ca3d2747ec
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.6.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.0
|
Release files / gpplot-0.5.0-py2.py3-none-any.whl
| Download URL | gpplot-0.5.0-py2.py3-none-any.whl |
|---|---|
| Size | 9.3 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
5d58a314612dcfe4075e27bf64a8cf787101f4d2120a5d80a70177c6419fcf17
|
|
BLAKE2b-256 checksum How to use checksums |
8d7a6a93371e0940bbc4cee478920fcbc2b502e86c34d2d2a3410e8c2b3546b7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.6.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.0
|