`from plotnine import *` ... I love the idea of a new python plotting library, but why is this anti-pattern so common with plotting libs?
Plotnine
11–20 of 83 posts
Re: Plotnine
#12`from plotnine import *` ... I love the idea of a new python plotting library, but why is this anti-pattern so common with plotting libs?
Disclaimer: I made the plotnine homepage and cheatsheet.
Re: Plotnine
#13Re: Plotnine
#14You can get a sneak peek by installing the pre-release:
pip install --pre plotnine
Details here: https://github.com/has2k1/plotnine/issues/1031
Disclaimer: I'm the author.
Re: Plotnine
#15Re: Plotnine
#16And it comes with tidyverse-like cheatsheet[1] that I confused with ggplot2 when first discovered plotnine [1]: https://github.com/rstudio/cheatsheets/blob/main/plotnine.pd...
Disclaimer: I am the author.
Re: Plotnine
#17Back when I did a lot of data stuff I used ggplot in R because it seemed to be popular, but I was just copy/pasting examples. Then one day I finally started to "get it" and actually read the manual. Learning the grammar of graphics was like a super power. I got to the point I could open pretty much anything people sent me and visualise it in a matter of seconds. Although I've used Python professionally a lot more tha…
Re: Plotnine
#18Using operator overloading of "+" to configure the plot is... a choice.
Like others mention, this is inspired by ggplot2, a Grammar of Graphics library. The whole idea is graphics are composed by adding "layers", not like layers on a canvas, but like pouring paint into a pot, then the library understands the content and paints it to the canvas.
Layers might be pure data, geometry (lines, points, ...), annotations, styles, axis, etc.
When you get familiar with it, it's much more natural way of describing plots, better composition and easier exploration
Re: Plotnine
#192 things that would be awesome are interactive plots (hover + text box) and chlorpleth (tiled map) plots.
On closer look you have already nailed the latter!
Re: Plotnine
#20Using operator overloading of "+" to configure the plot is... a choice.
It is! And that's kinda the point. Like others mention, this is inspired by ggplot2, a Grammar of Graphics library. The whole idea is graphics are composed by adding "layers", not like layers on a canvas, but like pouring paint into a pot, then the library understands the content and paints it to the canvas. Layers might be pure data, geometry (lines, points, ...), annotations, styles, axis, etc. When you get familia…