Live data from Hacker News

Plotnine

plotnine.org

21–30 of 83 posts

Re: Plotnine

#21

Nice one. I'm aware of plotnine because ggplot is more intuitive IMHO than say matplotlib. 2 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!

There is this new and very promising package that adds interactivity to plotnine graphs https://y-sunflower.github.io/ninejs/.

Disclaimer: I am the author of plotnine.

Re: Plotnine

#22
post #14

If you already use plotnine, or if this has piqued your interest, the next release (v0.16.0) will bring nice capabilities. You 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.

Minor nit, the "Installing" link on the linked page leads to the general documentation.

Re: Plotnine

#23
I've always liked the ggplot2 and the Grammar of Graphics approach to plotting so much so that I wrote my own DSL based on it - it is standalone, written in Rust, has WASM bindings (as you can see on the website) and more:

https://williamcotton.github.io/algraf

It pairs well with a related data translation DSL:

https://williamcotton.github.io/pdl

And you can see the two working together here:

https://williamcotton.github.io/datafarm-studio

There's LSPs for both, LSP clients for VS Code, and even language diagnostics for standalone Monaco editors in the browser.

Of note is that the same language diagnostics are exposed via the WASM as via the LSP interface allowing for the same friendly red squiggles to look and work the same in both your browser with Monaco and your editor with the LSP!

Re: Plotnine

#26
Plotnine has been great in my usage, but I see violin plots on the front page. Just say no to violin plots.

In almost any situation you either want to talk about the actual distribution (in which case plotting the distribution on one side of the line arranged horizontally is significantly superior to plotting it vertically on both sides of the line for some reason as a violin plot does[1]) or you want to talk about the quartiles etc in which case a boxplot is better.

A violin plot tries to do both and as a result does them both badly.

Extended anti-violin plot rant here https://www.youtube.com/watch?v=_0QMKFzW9fw

[1] I remember in one meeting before I knew better, producing some violin plots and putting them on a slide and I knew I had gone wrong when that slide came up and everyone in the room had this confused expression on their faces and was leaning their head over to the side to try to see the distribution better. When your visualization produces obvious confusion like that, you can be completely certain it has failed.

Re: Plotnine

#28
post #2

Using 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…

How `plot(.. + ggsize(700, 300) + ..)` is superior to a keyword parameter `plot(.. , size = (700, 300), ..)`?

Re: Plotnine

#30

I've always liked the ggplot2 and the Grammar of Graphics approach to plotting so much so that I wrote my own DSL based on it - it is standalone, written in Rust, has WASM bindings (as you can see on the website) and more: https://williamcotton.github.io/algraf It pairs well with a related data translation DSL: https://williamcotton.github.io/pdl And you can see the two working together here: https://williamcotton.gi…

[deleted]
Post reply on HN