I have an unpopular opinion: matplotlib sucks, but it's going to be really hard to improve on it.
I don't think I need to give anyone reasons why it sucks, but the reason it's going to be hard to replace is that it can do so much. You can make other plotting libraries that are way easier to do a small subset of things with, but as soon as you want strange, lower level, customizable things, you start having to build in little hacks and workarounds. If you have enough of these, you'll eventually get mpl.
I wanted to draw something I thought would be simple using matplotlib or seaborn. The components were themselves pretty standard:
1. A combo chart (two y variables: one as a line, one as vertical bars).
2. A facet grid (multiple charts with the same axis definition, with each chart representing a slice of the data).
#1 is easy in Excel
#2 is easy in Matplotlib
So I thought the combination of the two would be easy in Matplotlib. At first, it wasn't easy.
It turns out that, if you try and learn matplotlib by googling examples as and when you need them, you may not build a good mental model of how matplotlib charts work. So you hit a wall when you try to do something for which there's no good example online.
But if you read the documentation (particularly the page linked above), things get much easier and the frustration melts away.
Not to disagree... as a regular matplotlib user, I certainly overlook its quirks in return for what it can do for me. But I think another interpretation is: If you use a complex, flexible library long enough, your recurring themes will eventually evolve into a library that "wraps" the original library.
I get your point, but disagree. I agree mpl is very powerful and you can do almost anything with it, but the biggest problem with mpl is the default behaviour for many things is just plain horrible. Take subplots, axis labels and ticks. By default pretty much any attempt will yield overlapping/obscured labels or way too much whitespace. Tight_layout helps a bit but in my experience you essentially have to manually tweak spacing and margins every time.
Similarly things like traditional x/y plots with a centre axis with arrows are much harder than they should be (it can be done but is really quite a bit of hassle).
And there are lots of other, similar issues. I suspect the OP is correct and it will be very difficult to replace mpl for producing publish quality plots (I think for interactive plots it's much easier and already done), despite it's shortcomings, because it is so powerful.
I agree with your assessment. An important thing that you point out though, is that it takes regular use to get a good functional and flexible wrapper.
I occasionally (once every 4 months or so) have to create some plots for reports or analysis, and they are almost always very weird, dissimilar to previous plots. It always ends up being a huge pain, even if sometime in the past I've done something kind of like them (this is especially true for any kind of dynamic plots).
I've ended up building a pretty easy to modify plotting suite out of DearPyGui. I cannot recommend DPG enough, especially for high throughput or large scale plots. Immediate mode programming is a joy to work with, and it's pretty awesome being able to quickly toggle on and off any dataset in realtime.
I used to loose quite a bit of time making technical plots with Matplotlib, and set out to remove that overhead from my university projects. I got to learn some Python along the way, and this is the result!
It saves me quite some time, so I guessed I might as well share it :)
All feedback is welcome! It's my first library so there's quite a lot of room to grow. Thanks in advance for checking it out!
It seems like seaborn would be a step backwards if you're looking for fast plotting. Perhaps I got the wrong impression, but this month I spent some time helping a coworker migrate to plain matplotlib as the seaborn plots were taking minutes to process while my matplotlib based code took half a second.
Seaborn can definitely take longer to render than matplotlib in some (many?) cases, but is often much much faster in actually writing out the code to generate the plots.
I think when most people complain about 'matplotlib not being efficient' (or whatever), they're talking about the time it takes to hammer out the plot, not necessarily the render time (unless they're trying to do animations...)
Hey! Thanks a lot for checking it out! TL;DR:
1. Between Seaborn and MPL Plotter, I believe it comes to taste more than anything, and (somewhat arguably), I think MPL Plotter is a bit more concise. I really like how you can expand its functionality with Matplotlib, but that applies to both!
2. I recommend Datashader (https://datashader.org/) (HoloViz is super cool) and Vispy (https://vispy.org/). I found Vispy's documentation a bit lacking some time ago, but they probably have improved it since then, and it's very capable. Lastly, check Taichi (https://taichi.graphics/), might not be a conventional data representation library (or rather, not only), but it's amazing and worth a look.
To add some more depth to the Seaborn comparison, and not being an expert Seaborn user, I'd say:
1. MPL Plotter is lighter (but also with less wide-ranging plot options)
2. In my experience, MPL Plotter's presets (most importantly, the defaults from which you build your plots up) are more suitable for technical papers than Seaborn's.
And perhaps a bit more arguably (again, I'm not a Seaborn expert, please do correct me if you think otherwise):
3. I believe MPL Plotter gives you more fine-grained control over your plot. That's is for you to plot and customize as far as Matplotlib will take you in one line, while most Seaborn examples I've seen use pyplot snippets.
4. And following with the above, I believe the syntax is a little more concise.
Personally I like that MPL Plotter is fundamentally Matplotlib, so I can use any Matplotlib customization I might need seamlessly, and, if useful enough, add it later on as a method in MPL Plotter itself, which would be a bit harder on such an established project as Seaborn. It's just tastes at that point, and the flexibility of being a small project.
Oh and also check the MPL Plotter custom preset functions! Editing your plots from a dictionary with all modifiable parameters visible for you to uncomment and tune is one of the nicer things the library has to offer.
Hey! Thanks a lot for checking it out! I meant it as in learning Python myself while I was making it :)
As to the API, I've added "stability" indicators for every plotting method in the README, and the most unstable features (panes) have warnings.
I'm not sure how to deal with breaking changes if I make any (again, probably only to the 'panes' functions). I think I'll create a new release (so 3.n.n to 4.0.0 for example) and state it as clearly as possible in the commits. Of course my priority during development is avoiding such changes. Please let me know any thoughts on how to do better!
This looks interesting. I noticed that quite a few of the 2D plots in the documentation are supposed to have a square aspect ratio but don't. You could fix this by making the default plot shape square, or by putting aspect=1 in lots of places.
I don't think I need to give anyone reasons why it sucks, but the reason it's going to be hard to replace is that it can do so much. You can make other plotting libraries that are way easier to do a small subset of things with, but as soon as you want strange, lower level, customizable things, you start having to build in little hacks and workarounds. If you have enough of these, you'll eventually get mpl.