4 ms·
By far my favorite feature of matplotlib is that it produces readable and accessible plots by default. Font sizes and linewidths are not too small, the default
by fsh 3y ago
By far my favorite feature of matplotlib is that it produces readable and accessible plots by default. Font sizes and linewidths are not too small, the default color palette is colorblind-friendly, and the default colormaps are perceptually uniform. Other software (for example Matlab and Mathematica) have absolutely terrible defaults and require a lot of fiddling to get the plots right.
- qwertox 3y agoMy only issue with it is that you need a lot of tweaking to get a compact layout. Other than that, it's a key part of what makes Python such an incredibly useful language.
- hughess 3y agoThat fiddling used to drive me nuts in any of the tools I used to work with. It's part of the problem I'm trying to solve with my current open source project (evidence.dev) where we're tackling viz-as-code. You might find it interesting. Previous HN discussions: https://news.ycombinator.com/item?id=35645464 https://news.ycombinator.com/item?id=35645464 (97 comments) https://news.ycombinator.com/item?id=28304781 https://news.ycombinator.com/item?id=28304781 (91 comments)
- apwheele 3y agoIMO the font size is still too small (ditto for pretty much all stat software). But matplotlib makes it quite easy to change the default look, here is mine: import matplotlib theme = {'axes.grid': True, 'grid.linestyle': '--', 'legend.framealpha': 1, 'legend.facecolor': 'white', 'legend.shadow': True, 'legend.fontsize': 14, 'legend.title_fontsize': 16, 'xtick.labelsize': 14, 'ytick.labelsize': 14, 'axes.labelsize': 16, 'axes.titlesize': 20, 'figure.dpi': 100} matplotlib.rcParams.update(theme)
- ithinkso 3y agoTangential but a thing about defaults - when I was at uni, in a lot of labs we were doing data analysis and plotting in something called Origin. I absolutely loved the defaults there, to this day I can recognize if it was plotted using origin and I had visceral reaction if I'd see something done in Excel. Sane defaults are very important and I'm not sure why they are often afterthoughts
- mpetroff 3y ago> the default color palette is colorblind-friendly No, it very much isn't. The second and third colors, the orange and the green, look extremely similar to protanopes (red deficiency). Fortunately, there's a plan to fix this for Matplotlib 4.0.