by mangecoeur · 2y ago · 0 comments
Seriously though, there have been many attempts to make a "better matplotlib" and yet it's still going strong - mostly because when you really get into scientific plotting and need print quality plots or embed plots in an GUI with very specific parameters it's hard to beat. Sometimes you just need to place a label in a specific spot and that's where a lot of alternatives fall down. That and the multiple very mature backends and library integrations.
P.S. I also highly recommend using the object base API. There's a lot of learning material around the web that still uses the old MatLab inspired plotting api which has a plot of gotchas, the object based one is pretty clean.
All this versatility comes at the expense of ease of use. It could certainly do a better job of making the simple common use cases more straightforward.
gnuplot arguably has similar power and versatility and it does make the simple stuff easier.
One thing that matplotlib is IMO bad at is interactive plots. They are very slow, and the controls are not intuitive. 99% of the time you just want to zoom and pan and those should be default actions.
gnuplotlib looks interesting and I will have a look, but these days most of the plots I do are in jupyter notebooks and I really want inline interactive plots so I don't think I will use it much. FWIW, what I use currently is plotly - the interactivity is very good (way better than matplotlib's) and plotly.express is very easy to use for the simple use cases.
There is so much matplotlib and plotly code on the web, that nothing else comes close to the effortless plotting of matplotlib/plotly.
I almost never have to write the styling myself. LLMs understand matplotlibs complex, but well specified docs really really well.
This points to a larger trend. If you want your language or hard-to-learn tool to get adoption. Then you better have an LLM that does 90% of the work for newcomers.
It's the '*a language is only as good as its idee*' phenomenon that every Java user is surely aware of; but 2024 version.