backstrip

Backstrip adds color-coordinated fill behind matplotlib boxplots

https://github.com/mmore500/backstrip

Science Score: 67.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 6 DOI reference(s) in README
  • Academic publication links
    Links to: zenodo.org
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (9.3%) to scientific vocabulary
Last synced: 10 months ago · JSON representation ·

Repository

Backstrip adds color-coordinated fill behind matplotlib boxplots

Basic Info
  • Host: GitHub
  • Owner: mmore500
  • License: mit
  • Language: Python
  • Default Branch: master
  • Size: 191 KB
Statistics
  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • Open Issues: 0
  • Releases: 1
Created over 2 years ago · Last pushed over 2 years ago
Metadata Files
Readme License Citation

README.md

PyPi CI GitHub stars DOI

backstrip adds color-coordinated fill behind matplotlib boxplots

Install

python3 -m pip install backstrip

Example Usage

```python3 from backstrip import backstrip from matplotlib import pyplot as plt import seaborn as sns

titanic = sns.load_dataset("titanic") ax = sns.boxplot(data=titanic, x="age", y="class", hue="alive", orient="h") backstrip(ax, hatch=["oo", "xx"], orient="h")

plt.show() ```

example


```python3 from backstrip import backplot from matplotlib import pyplot as plt import seaborn as sns

g = backplot( data=sns.load_dataset("titanic"), x="class", y="age", hue="alive", col="who", style="alone", # hatches by this column )

plt.show() ```

example

API

See function docstrings for full parameter and return value descriptions.

backstrip: direct, axes-level interface

```python3 def backstrip( ax: plt.Axes, alpha: float = 0.5, hue: typing.Optional[typing.Iterable[str]] = None, hatch: typing.Optional[typing.Iterable[str]] = None, hatch_color: typing.Union[str, typing.Iterable[str]] = "white", orient: typing.Literal["v", "h"] = "v", **kwargs, ) -> None: """Draws background strips behind boxplot patches on a matplotlib Axes object to enhance the visual identifiability of hue-keyed groups.

This function iterates over PathPatch objects (representing boxes) within a
matplotlib Axes, and draws semi-transparent rectangles (strips) in the
background.

These strips can be customized in color (`hue`), pattern (`hatch`), and
orientation (`orient`).
"""

```

backplot: tidy-data, figure-level interface

```python3 def backplot( data: pd.DataFrame, x: typing.Optional[str] = None, y: typing.Optional[str] = None, hue: typing.Optional[str] = None, style: typing.Optional[str] = None, col: typing.Optional[str] = None, row: typing.Optional[str] = None, order: typing.Optional[typing.Sequence[str]] = None, hueorder: typing.Optional[typing.Sequence[str]] = None, styleorder: typing.Optional[typing.Sequence[str]] = None, hatches: typing.Optional[typing.Sequence[str]] = None, orient: typing.Literal["v", "h"] = "v", palette: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, backstripkws: dict = frozendict(), legendwidthinches: float = 1.5, legendkws: dict = frozendict(), **kwargs: dict, ) -> sns.FacetGrid: """Create a composite plot that combines boxplots with backstrips, optionally hatched according to a categorical style variable.

Provides a tidy-data, seaborn-like interface for backstrip elements. Unlike
backstrip, this function uses the seaborn.catplot interface to create
boxplots (and then applies backstrips to the resulting axes).

Notes
-----
If boxplot strips contain more than one style column value, they will be
hatched with both (or all) corresponding hatch patterns.
"""

```

Citing

If backstrip contributes to a scientific publication, please cite it as

Matthew Andres Moreno. (2024). mmore500/backstrip. Zenodo. https://doi.org/10.5281/zenodo.10701180

bibtex @software{moreno2024backstrip, author = {Matthew Andres Moreno}, title = {mmore500/backstrip}, month = feb, year = 2024, publisher = {Zenodo}, doi = {10.5281/zenodo.10701180}, url = {https://doi.org/10.5281/zenodo.10701180} }

Consider also citing matplotlib and seaborn. And don't forget to leave a star on GitHub!

Owner

  • Name: Matthew Andres Moreno
  • Login: mmore500
  • Kind: user
  • Location: East Lansing, MI
  • Company: @devosoft

doctoral student, Computer Science and Engineering at Michigan State University

Citation (CITATION.cff)

cff-version: 1.1.0
message: "If you use this software, please cite it as below."
title: 'backstrip: a Python library to enhance categorical distribution plots'
abstract: "backstrip adds color-coordinated fill behind matplotlib boxplots."
authors:
- family-names: Moreno
  given-names: Matthew Andres
  orcid: 0000-0003-4726-4479
date-released: 2024-02-24
doi: 10.5281/zenodo.10701180
license: MIT
repository-code: https://github.com/mmore500/backstrip
url: "https://github.com/mmore500/backstrip"

GitHub Events

Total
Last Year

Committers

Last synced: 11 months ago

All Time
  • Total Commits: 29
  • Total Committers: 1
  • Avg Commits per committer: 29.0
  • Development Distribution Score (DDS): 0.0
Past Year
  • Commits: 0
  • Committers: 0
  • Avg Commits per committer: 0.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
Matthew Andres Moreno m****g@g****m 29

Issues and Pull Requests

Last synced: 10 months ago

All Time
  • Total issues: 0
  • Total pull requests: 1
  • Average time to close issues: N/A
  • Average time to close pull requests: 6 minutes
  • Total issue authors: 0
  • Total pull request authors: 1
  • Average comments per issue: 0
  • Average comments per pull request: 0.0
  • Merged pull requests: 1
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
Pull Request Authors
  • mmore500 (2)
Top Labels
Issue Labels
Pull Request Labels