Package: cowpatch
cowpatchA package for combining/aranging multiple python ggplot visuals fromplotnine. Internally, we leverage SVG objects and descriptions to accomplish it's goals.InstallationTo install the current version of this package, please runpip install cowpatchIf you would like to experiment with the development version of this package
please following the guidelines in the contributing page.Usageimportcowpatchascowimportplotnineasp9importplotnine.dataasp9_dataimportnumpyasnp# creation of some some ggplot objectsg0=p9.ggplot(p9_data.mpg)+\p9.geom_bar(p9.aes(x="hwy"))+\p9.labs(title='Plot 0')g1=p9.ggplot(p9_data.mpg)+\p9.geom_point(p9.aes(x="hwy",y="displ"))+\p9.labs(title='Plot 1')g2=p9.ggplot(p9_data.mpg)+\p9.geom_point(p9.aes(x="hwy",y="displ",color="class"))+\p9.labs(title='Plot 2')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)Please see additional documentation pages like "Getting-Started" and the
individual pages on different plot arrangement strategies.Future GoalsThis 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 followingMVP #1: base implimentation (reflectingcowplotandgridExtrafunctionality, minus labeling and titles)MVP #2: figure labeling and titles andcow.text()objectsMVP #3: "Arithmetic of arrangement" (reflectingpatchwork)In addition, we envision the following features coming along in parallel:inseting plots (like seen incowplot)wrapping ofmatplotlib,plotnineandseabornplots to work within thecowpatchframework and within thepatchworkframeworkmore complex drawing tools like theRpackagegridto allow for easy creation of complex featuresFor the interested reader, a lot of these ideas have been sketched in ournotes/folder as "proof of concepts".Package LogisticsBackground and historyThis package's name is a merging of the names ofRpackages'cowplotandpatchwork. It attempts to provide similar plot arrangement and combination tools asgridExtra,cowplotandpatchworkfor theplotnine'sggplotobjects.This package is not directly related to any of aforementioned packages (including theWilke 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.ContributingInterested 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.Licensecowpatchwas created byBenjamin LeRoy(benjaminleroy) and Mallory Wang (wangmallory). It is licensed under the terms of the MIT license.CreditsThispythonpackage stands on the shoulders of many open-source tools,cowpatchstructure was created withcookiecutterand thepy-pkgs-cookiecuttertemplate, the documentation leveragessphinx, and underlying testing leveragespytest,hypothesisandpytest-regression. See the full list of package dependencies onGithub.