8 ms·
Lets-plot: An interactive Python plotting library using ggplot's API
- iav 6y agoHow is it different from plotnine? https://projectcodeed.blogspot.com/2020/07/ggplot-grammar-of-graphics-in-python.html https://projectcodeed.blogspot.com/2020/07/ggplot-grammar-of...
- gimboland 6y agoFrom a cursory glance at both projects, it looks like plotnine doesn't do interactivity, for a start?
- iav 6y agoI wonder why they decided to start from scratch in Kotlin rather than just add the interactivity feature to plotnine. Now we have two competing projects...
- disgruntledphd2 6y agoI'm pretty sure that there have been multiple attempts to recreate ggplot in python. I can think of 3-4 off the top of my head.
- closed 6y agoAFAIK plotnine is the only one with substantial adoption (2.3k stars on github) and active development for several years. Would be curious to hear which ones you're thinking of (since I wouldn't be surprised if the are others, but also am guessing no others hit both points)
- laserson 6y agoAltair does Grammar of Graphics and interactivity, and has ~6k stars.
- disgruntledphd2 6y agoHonestly, I've definitely seen at least 3-4 attempts hit HN over the past nine years or so. Plotnine is the only one another human has told me about, though.
- huac 6y agoI'm a big fan of Plotnine and recommend it to anyone who will listen. My (wildly speculative) guess for the motivations behind this library would be that Kotlin, as a base, is usable in the other JetBrains IDE's, e.g. reusing the same library and grammar when developing in Java or Ruby.
- leemailll 6y agoI don’t think ggplot2 has API
- vlovich123 6y agoRead beyond the headline. > The Lets-Plot for Python library includes a native backend and a Python API, which was mostly based on the ggplot2 package well-known to data scientists who use R. > R ggplot2 has extensive documentation and a multitude of examples and therefore is an excellent resource for those who want to learn the grammar of graphics. > Note that the Python API being very similar yet is different in detail from R. Although we have not implemented the entire ggplot2 API in our Python package, we have added a few new features to our Python API.
- Tarq0n 6y agoEvery library has an api, unless you're using some protocol-only definition of api.
- neves 6y agoI've been a Python lover for decades. I dislike a lot of characteristics of the R language, but the ggplot2 package is superior to anything in Python visualization space. It is really excellent.
- c06n 6y agoDepends, it does not do interactive 3D-plots. For that, Plotly is the only performant lib I know.
- xioxox 6y agoHave a go with the Veusz package (I'm lead author). It does interactive 3D plots, has a GUI and Python interface. I think the 3D speed is reasonable (providing the BSP clipping isn't switched on). http://veusz.github.io/ http://veusz.github.io/
- neves 6y ago3D plots are usually bad :-) Your vision system can't compare volume very well.
- crispyambulance 6y agoWickham was really on to something with ggplot and it's graphical grammar concept for plots. That and Tidyverse in general, I believe, has saved R from irrelevance. I wish more projects would use that way of thinking but it seems that in the jupyter/julia/python world there's too many choices and they all attempt a "kitchen-sink" approach for visualization.
- bransonf 6y ago> Tidyverse in general, I believe, has saved R from irrelevance. It’s interesting that you say this. I’ve been using R daily for almost 3 years now, and I was originally taught the Tidyverse. However, I also tutored in biostats and have collaborated with many different faculty and students. On one hand the Tidyverse created an opening for R learners especially, but it has lead to some controversy as well. Trust me when I say there are plenty of R users who have never heard of or used the Tidyverse. It leads to some difficulty in teaching/collaborating because do I use grepl or str_detect? lapply or map? Do they know the magrittr syntax (%>%)? Then there’s non-standard evaluation, which often forces some arbitrary meta-programming on novice programmers. R is foremost the stats language, and tidyverse has attempted to make it more general purpose, for better or worse depending on who you ask.
- deleted 6y ago[deleted]
- befeltingu 6y agoLooks interesting but it feels like this space is a bit crowded with all of the plotting libraries out there for python.
- antipaul 6y agoAnd yet none has filled the “enjoyable to use” space ;)
- befeltingu 6y agoYa true. I usually end up jumping around depending on use case. Matplotlib ,seaborn, plotly to name a few.
- sandGorgon 6y agoDo try Altair. Here's a post from someone who comes from ggplot2 to Altair - http://fernandoi.cl/blog/posts/altair/ http://fernandoi.cl/blog/posts/altair/ here's the path to Altair scrapping 20k lines of code to make the api simpler - https://twitter.com/jakevdp/status/1006929128119926786 https://twitter.com/jakevdp/status/1006929128119926786 Altair is really good. Probably as good as ggplot2
- tbenst 6y agoI love Altair but the practice of encoding data alongside the plots makes it unwieldy for sharing jupyter notebooks (by default a 5000 row limit). Github also fails to preview Altair plots in .ipynb right now
- theandycamps 6y agoI've been using R professionally for 4 years. I've been a Python programmer for 6 years. I've shipped large scale applications built on both languages to production. Findings: I honestly don't get the hype around R's plotting capabilities. ggplot2 is nice, but far too magical to be easily understood by beginners. Python offers more intuitive memory management than R (which is really more a statement on how bad R is at memory efficiency). R blows Python out of the water when it comes to expressing concise and readable linear algebra/stats computation. Done right, base R looks like mathematical pseudo-code. R's non-standard evaluation is an under-appreciated killer feature. I've seen complex and powerful DSLs implemented implemented in base R. Python has some support for this kind of thing, but nowhere near the level of R. I tried the Tidyverse and found it to be too magical and unstable. In general, the R package ecosystem is weird. Look at Stack Overflow and you'll find people touting all sorts of different packages to do simple operations. Needing to download a million random packages from grad students of the internet is a recipe for disaster.
- prionassembly 6y agoDo you have any insights on Julia?
- throwaway29103 6y agoI am not the person you are asking, but having used octave, matlab, R, Python for many years and julia for about a month I think that for numerical/algebraic stuff, julia is the one to go; the only reason holding me back is that communities using octave-matlab-R need to be convinced and their codebases need to be ported.
- throwaway29103 6y agoGenuinely curious: what do you mean with respect to "R's non-standard evaluation" and its relationship to DSLs? Thanks in advance.
- CreRecombinase 6y agoR some very lispy meta-programming features. Very briefly, if I'm a function (go with me here) `foo <- function(x,y){whatever}`,and someone calls me, `foo(bar,baz)` I get to know that `baz` is "bound" to `y`. The caller doesn't even have to have a `baz` in scope; substituting `y` for `baz` is done lazily, if the function never asks for the actual value of `y`, there's no problem. You can read more about this here http://adv-r.had.co.nz/Computing-on-the-language.html http://adv-r.had.co.nz/Computing-on-the-language.html
- neves 6y agoIs this an official JetBrains project? Will it be supported?
- proverbialbunny 6y agoYes. You can see it in the url: https://github.com/JetBrains/lets-plot/ https://github.com/JetBrains/lets-plot/
- neves 6y agoBut does it means that it is a corporate project. Something that won't die when its leader get a better job?