TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Plotnine: A grammar of graphics for Python

170 pointsby carlosggalmost 8 years ago

9 comments

peatmossalmost 8 years ago
I feel like a lot of attempts to recreate ggplot2 end up being superficial because they don&#x27;t recognize &#x2F; duplicate the power of the underlying Grid graphics that ggplot2 uses.<p>I know that web technologies are all the rage these days, but at least for static, publication-ready graphics, Grid is really nice substrate, with well thought out lower-level abstractions.<p>EDIT: I should also add that it&#x27;s documented within an inch of its life should anyone feel that it&#x27;s worth recreating: <a href="https:&#x2F;&#x2F;stat.ethz.ch&#x2F;R-manual&#x2F;R-devel&#x2F;library&#x2F;grid&#x2F;html&#x2F;grid-package.html" rel="nofollow">https:&#x2F;&#x2F;stat.ethz.ch&#x2F;R-manual&#x2F;R-devel&#x2F;library&#x2F;grid&#x2F;html&#x2F;grid...</a>
评论 #14431520 未加载
has2k1almost 8 years ago
Surprise to see this at the top, I am the creator* of plotnine. The most common question seems to be, what to expect of plotnine? The answer; a high quality implementation of a grammar of graphics with an API that closely matches ggplot2, and more.<p>I also want other packages to be able to build off of plotnine, e.g. a package with the functionality of Seaborn could be built off of plotnine. The only constraint should be whether the backend -- in this case Matplotlib -- does stand in the way. Matplotlib is evolving (though slowly) and has a very receptive community so there is lots of hope.<p>* - Many people contributed to its history.
评论 #14432504 未加载
评论 #14432303 未加载
sirricealmost 8 years ago
Recreating and keeping up with Hadley&#x27;s hard work is challenging, particularly because ggplot2&#x27;s layout and extensions are really nice and continue to evolve.<p>As an alternative that preserves the full power of Wickham&#x27;s implementation, pygg[1] is a Python wrapper that provides R&#x27;s ggplot2 syntax in Python and runs everything in R.<p>[1] <a href="https:&#x2F;&#x2F;github.com&#x2F;sirrice&#x2F;pygg" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;sirrice&#x2F;pygg</a>
skierscottalmost 8 years ago
Another grammar of graphics: altair[1]. The altair are simpler and easier to read, i.e.<p><pre><code> Chart(df).mark_point().encode( x=&#x27;age&#x27;, y=&#x27;height&#x27;, color=&#x27;sex&#x27;) </code></pre> Also, see Jake Vaderplas&#x27;s talk on an overview of Python visualization tools at <a href="https:&#x2F;&#x2F;youtube.com&#x2F;watch?v=FytuB8nFHPQ" rel="nofollow">https:&#x2F;&#x2F;youtube.com&#x2F;watch?v=FytuB8nFHPQ</a><p>[1]:<a href="https:&#x2F;&#x2F;altair-viz.github.io" rel="nofollow">https:&#x2F;&#x2F;altair-viz.github.io</a>
vignesh_malmost 8 years ago
If this is an implementation of ggplot2, what does it offer over <a href="http:&#x2F;&#x2F;ggplot.yhathq.com&#x2F;" rel="nofollow">http:&#x2F;&#x2F;ggplot.yhathq.com&#x2F;</a>?<p>I don&#x27;t mean to undermine your project, just wanted to know about significant differences.
评论 #14430662 未加载
评论 #14432511 未加载
评论 #14430686 未加载
评论 #14431390 未加载
Waterluvianalmost 8 years ago
What is meant by &quot;a grammar&quot;?<p>Is it the way we concatenate functions to create what&#x27;s essentially a sentence of what we want the plot to be?
评论 #14431396 未加载
评论 #14431298 未加载
staredalmost 8 years ago
I get it is ggplot-based, by as it is Python, why not being more idiomatic and using chaining instead of adding?
coldteaalmost 8 years ago
This is nice and all, but the syntax and names are totally unintuitive.<p>If I&#x27;m to dig in the manual, I might as well build my plots with the standard syntax of any random plotting library.<p>Is this &quot;grammar of graphics&quot; any good if you invest more time in it?
评论 #14430785 未加载
评论 #14430782 未加载
评论 #14431595 未加载
评论 #14431062 未加载
lorenzfxalmost 8 years ago
This looks interesting, but I find the documentation somewhat lacking. Is the user supposed to know ggplot?