Seaborn-like API for some plotly plots
Project description
Bornly
Seaborn-like API for interactive plotly visualisations
Installation
Note: the $
is not part of the command:
$ pip install -U bornly
Examples
Lineplot
import bornly as bns
fmri = bns.load_dataset("fmri")
ax = bns.lineplot(data=fmri, x="timepoint", y="signal", hue="event")
ax.figure
Barplot
import bornly as bns
tips = bns.load_dataset("tips")
ax = bns.barplot(x="day", y="total_bill", data=tips, hue="time")
ax.figure
Scatterplot
import bornly as bns
diamonds = bns.load_dataset("diamonds")
ax = bns.scatterplot(
x="carat",
y="price",
hue="clarity",
size="depth",
palette="ch:r=-.2,d=.3_r",
sizes=(1, 8),
data=diamonds,
)
ax.figure
Kdeplot
import bornly as bns
iris = bns.load_dataset("iris")
ax = bns.kdeplot(data=iris)
ax.figure
from string import ascii_letters
import numpy as np
import pandas as pd
import bornly as bns
import matplotlib.pyplot as plt
# Generate a large random dataset
rs = np.random.RandomState(33)
d = pd.DataFrame(data=rs.normal(size=(100, 26)), columns=list(ascii_letters[26:]))
# Compute the correlation matrix
corr = d.corr()
# Generate a mask for the upper triangle
mask = np.triu(np.ones_like(corr, dtype=bool))
# Generate a custom diverging colormap
cmap = bns.diverging_palette(230, 20, as_cmap=True)
# Draw the heatmap with the mask and correct aspect ratio
ax = bns.heatmap(corr, mask=mask, cmap=cmap, vmax=0.3, center=0)
ax.figure
Pairplot
import bornly as bns
penguins = bns.load_dataset("penguins")
bns.pairplot(penguins, hue="species")
Histplot
import bornly as bns
penguins = bns.load_dataset("penguins")
ax = bns.histplot(data=penguins, x="flipper_length_mm", hue="species")
ax.figure
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
bornly-0.3.0.tar.gz
(7.2 MB
view details)
Built Distribution
bornly-0.3.0-py3-none-any.whl
(319.5 kB
view details)
File details
Details for the file bornly-0.3.0.tar.gz
.
File metadata
- Download URL: bornly-0.3.0.tar.gz
- Upload date:
- Size: 7.2 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.0 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ecdc5626104fcb254e61060148c84b1b8bb0dedb95d036e45b35be76bb717345 |
|
MD5 | d917398f15437eaeb7af863931a39981 |
|
BLAKE2b-256 | 7ab11620deced6cfdc67cca15c4c0572eb4b165e554d2049cb8b564235e0d778 |
Provenance
File details
Details for the file bornly-0.3.0-py3-none-any.whl
.
File metadata
- Download URL: bornly-0.3.0-py3-none-any.whl
- Upload date:
- Size: 319.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.0 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 79c69e00b52927531b9e5549f0cc9e3a95c127eaa8f0bc09caf7ea7291a49117 |
|
MD5 | ea388306cb317abdc5388329ea35c8e8 |
|
BLAKE2b-256 | e42908b389ed0d024c247112c18afebe2db98f8367c400e4214529ac8923e8f7 |