https://github.com/benjaminleroy/cowpatch

pythonic ggplot image combinations https://benjaminleroy.github.io/cowpatch

https://github.com/benjaminleroy/cowpatch

Science Score: 26.0%

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

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (15.0%) to scientific vocabulary

Keywords

graphics plotting python svg
Last synced: 6 months ago · JSON representation

Repository

pythonic ggplot image combinations https://benjaminleroy.github.io/cowpatch

Basic Info
  • Host: GitHub
  • Owner: benjaminleroy
  • License: mit
  • Language: Jupyter Notebook
  • Default Branch: main
  • Homepage:
  • Size: 13.8 MB
Statistics
  • Stars: 10
  • Watchers: 2
  • Forks: 2
  • Open Issues: 5
  • Releases: 0
Topics
graphics plotting python svg
Created about 4 years ago · Last pushed about 3 years ago
Metadata Files
Readme Changelog Contributing License

README.md

cowpatch

test and codecov codecov CodeFactor

A package for combining/aranging multiple python ggplot visuals from plotnine<!--, with allowances to also combined figures from matplotlib and seaborn-->. Internally, we leverage SVG objects and descriptions to accomplish it's goals.

Installation

To install the current version of this package, please run

pip install cowpatch

If you would like to experiment with the development version of this package please following the guidelines in the contributing page.

Usage

python import cowpatch as cow import plotnine as p9 import plotnine.data as p9_data import numpy as np

```python

creation of some some ggplot objects

g0 = p9.ggplot(p9data.mpg) +\ p9.geombar(p9.aes(x="hwy")) +\ p9.labs(title = 'Plot 0')

g1 = p9.ggplot(p9data.mpg) +\ p9.geompoint(p9.aes(x="hwy", y = "displ")) +\ p9.labs(title = 'Plot 1')

g2 = p9.ggplot(p9data.mpg) +\ p9.geompoint(p9.aes(x="hwy", y = "displ", color="class")) +\ p9.labs(title = 'Plot 2') ```

python vis_patch = cow.patch(g0,g1,g2) vis_patch += cow.layout(design = np.array([[0,1], [0,2]]), rel_heights = [1,2]) vis_patch.show(width = 11, height = 7) <!-- python vis_patch.save(width=11, height=7, filename="images/readme.svg") --> cowpatch example

Please see additional documentation pages like "Getting-Started" and the individual pages on different plot arrangement strategies.

Future Goals

This package is currently in development (please feel welcome to contribute, with code, examples, issues, publicity, etc.). We envision a sequence of versions coming out with different added features in each. The order of the features will look something like the following

  • [x] MVP #1: base implimentation (reflecting cowplot and gridExtra functionality, minus labeling and titles)
  • [ ] MVP #2: figure labeling and titles and cow.text() objects
  • [ ] MVP #3: "Arithmetic of arrangement" (reflecting patchwork)

In addition, we envision the following features coming along in parallel:

  • [ ] inseting plots (like seen in cowplot)
  • [ ] wrapping of matplotlib, plotnine and seaborn plots to work within the cowpatch framework and within the patchwork framework
  • [ ] more complex drawing tools like the R package grid to allow for easy creation of complex features

For the interested reader, a lot of these ideas have been sketched in our notes/ folder as "proof of concepts".

Package Logistics

Background and history

This package's name is a merging of the names of R packages' cowplot and patchwork. It attempts to provide similar plot arrangement and combination tools as gridExtra, cowplot and patchwork for the plotnine's ggplot objects.

This package is not directly related to any of aforementioned packages (including the Wilke Lab, lead by Claus O. Wilke) but naturally stands on the shoulders of the contributions each of the packages made.

This package leverages a SVG backend to create the arangements. This may make the actual package a bit more "hacky" then some may like, but we hope it can still be of use to the community.

Contributing

Interested in contributing? Check out the contributing guidelines. Please note that this project is released with a Code of Conduct. By contributing to this project, you agree to abide by its terms.

License

cowpatch was created by Benjamin LeRoy (benjaminleroy) and Mallory Wang (wangmallory). It is licensed under the terms of the MIT license.

Credits

This python package stands on the shoulders of many open-source tools, cowpatch structure was created with cookiecutter and the py-pkgs-cookiecutter template, the documentation leverages sphinx, and underlying testing leverages pytest, hypothesis and pytest-regression. See the full list of package dependencies on Github.

Owner

  • Name: Benjamin LeRoy
  • Login: benjaminleroy
  • Kind: user
  • Location: Portland, OR

Data Scientist, Statistics Ph.D. Carnegie Mellon University

GitHub Events

Total
  • Watch event: 1
Last Year
  • Watch event: 1

Committers

Last synced: 7 months ago

All Time
  • Total Commits: 102
  • Total Committers: 1
  • Avg Commits per committer: 102.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
benjaminleroy b****a@g****m 102

Issues and Pull Requests

Last synced: 7 months ago

All Time
  • Total issues: 11
  • Total pull requests: 10
  • Average time to close issues: 24 days
  • Average time to close pull requests: 1 day
  • Total issue authors: 2
  • Total pull request authors: 1
  • Average comments per issue: 1.36
  • Average comments per pull request: 0.7
  • Merged pull requests: 9
  • 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
  • benjaminleroy (10)
  • AlFontal (1)
Pull Request Authors
  • benjaminleroy (10)
Top Labels
Issue Labels
enhancement (3) documentation (2) help wanted (1) good first issue (1)
Pull Request Labels
documentation (1)

Packages

  • Total packages: 1
  • Total downloads:
    • pypi 21 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 1
  • Total versions: 2
  • Total maintainers: 1
pypi.org: cowpatch

A package for combining python ggplot visuals

  • Versions: 2
  • Dependent Packages: 0
  • Dependent Repositories: 1
  • Downloads: 21 Last month
Rankings
Dependent packages count: 10.1%
Stargazers count: 17.7%
Dependent repos count: 21.5%
Forks count: 22.6%
Average: 23.5%
Downloads: 45.5%
Maintainers (1)
Last synced: 7 months ago

Dependencies

pyproject.toml pypi
  • hypothesis ^6.36.2 develop
  • jupyter-contrib-nbextensions ^0.5.1 develop
  • jupyter_nbextensions_configurator ^0.4.1 develop
  • myst-nb ^0.13.1 develop
  • pandas ^1.3.5 develop
  • pytest ^7.0.0 develop
  • pytest-cov ^3.0.0 develop
  • pytest-regressions ^2.3.1 develop
  • sphinx-autoapi ^1.8.4 develop
  • sphinx-rtd-theme ^1.0.0 develop
  • CairoSVG ^2.5.2
  • ipython ^8.0.1
  • matplotlib ^3.5.1
  • numpy ^1.21.4
  • plotnine ^0.8.0
  • python >=3.8,<3.11
  • svgutils ^0.3.4
docs/requirements.txt pypi
  • myst-nb *
  • sphinx-autoapi *
  • sphinx-rtd-theme *
poetry.lock pypi
  • 149 dependencies
.github/workflows/build-docs.yml actions
  • JamesIves/github-pages-deploy-action 4.1.4 composite
  • actions/checkout master composite
  • actions/setup-python v2 composite
  • snok/install-poetry v1 composite
.github/workflows/ci.yml actions
  • actions/checkout v2 composite
  • actions/setup-python v2 composite
  • codecov/codecov-action v2 composite
  • snok/install-poetry v1 composite