4 ms·
Matplotlib basically has two APIs, the global state Matlab-like one PyPlot (which is often used in beginner tutorials), and a much nicer object-oriented API, wh
by mkl 9y ago
Matplotlib basically has two APIs, the global state Matlab-like one PyPlot (which is often used in beginner tutorials), and a much nicer object-oriented API, where state is explicitly connected to the plot components.
To quote from their documentation [1]: "While it is easy to quickly generate plots with the matplotlib.pyplot module, we recommend using the object-oriented approach for more control and customization of your plots."
I use matplotlib.pyplot for basically only two purposes, calling subplots to get figure and axis objects, or calling rc_context to set up a "with" block with certain settings (e.g. font size).
That said, I'm certainly watching where alternative plotting libraries are going. I've used bqplot a bit, but only played around with others so far.
[1] https://matplotlib.org/api/pyplot_summary.html#the-object-oriented-api https://matplotlib.org/api/pyplot_summary.html#the-object-or...