A few handy extension plots using seaborn API.
Project description
seabornxt
A few handy extension plots using seaborn API.
To install:
You can install from PyPI as follows:
pip install seabornxt
or you can install it from the GitHub repository:
git clone https://github.com/LeSasse/seabornxt.git
cd seabornxt
pip install .
Use example:
import seaborn as sns
from seabornxt import stripboxplot
def main():
tips = sns.load_dataset("tips")
plot = stripboxplot(data=tips, x="day", y="total_bill", hue="smoker")
fig = plot.get_figure()
fig.savefig("stripboxplot.pdf")
if __name__ == "__main__":
main()
Results in:
Customise box and strip plots:
You can customise the box and strip plots by passing over the
strip_kwargs
and box_kwargs
dictionaries. The following
example displays data points in the same colour as the box plots:
import seaborn as sns
from seabornxt import stripboxplot
def main():
tips = sns.load_dataset("tips")
plot = stripboxplot(
data=tips,
x="day",
y="total_bill",
hue="smoker",
strip_kwargs={"jitter": True, "alpha": 0.8},
box_kwargs={"boxprops": {"alpha": 0.4}},
)
fig = plot.get_figure()
fig.savefig("stripboxplot_colors.svg")
if __name__ == "__main__":
main()
Another dataset:
import seaborn as sns
from seabornxt import stripboxplot
def main():
penguins = sns.load_dataset("penguins")
plot = stripboxplot(
data=penguins,
x="sex",
y="body_mass_g",
hue="species",
)
fig = plot.get_figure()
fig.savefig("stripboxplot_penguins.svg")
if __name__ == "__main__":
main()
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
seabornxt-0.0.1.dev13.tar.gz
(50.7 kB
view hashes)
Built Distribution
Close
Hashes for seabornxt-0.0.1.dev13-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e4d58332783d1ad9f4769811b9c6107ab3ac43d85709b9063d5292f6f9b9dc7c |
|
MD5 | c55b6f878725448254a5c9d809ff0b31 |
|
BLAKE2b-256 | 138a2cff978b99b8557fdac151498e2d5323caffa3822c5c4f190b75d5f579ec |