|
|
|
|
|
by mlurp
1867 days ago
|
|
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.