3 ms·
Minor gripe - These sort of tools always deride matplotlib a bit, but often show outright incorrect examples of using it. Admittedly, the "right" way of doing
by jofer 8y ago
Minor gripe - These sort of tools always deride matplotlib a bit, but often show outright incorrect examples of using it.
Admittedly, the "right" way of doing it is quite clunky as well:
ax.xaxis.set(major_formatter=StrMethodFormatter('{:0.0f}%'))
The example shown teaches very bad habits. It doesn't change the tick label formatting at all. It makes the ticks and labels static. There's a big difference, and it's obvious as soon as you interact with the plot (i.e. zoom/pan around - you won't get new ticks/labels).
I agree that matplotlib isn't the right choice for web-based visualization, but let's not pretend it makes static plots. It's a very, very highly interactive desktop visualization package, and oriented towards building desktop applications that can produce publication-quality plots.
All that having been said, this looks pretty neat.
- jlelonm 8y agoAs someone who uses matplotlib to make plots pretty frequently (but also struggles getting it to do the right thing often, most likely due to accumulation of bad habits), can you recommend a good resource to learn the good habits? It seems like there are n different ways to do everything - I'd love to learn to work more efficiently.
- reasonablemann 8y agoUnless you're making high quality prints I would recommend staying away from matplotlib. That's it's purpose and if you ever use large amounts of data it slows to a crawl. It's a real shame that it's the default plotter for pandas. I imagine I've wasted a full 24 hours in total for plots to show up over the past few years.