16 comments

[ 4.8 ms ] story [ 72.0 ms ] thread
Did not realise matplotlib had style sheets, that could have been useful. Thanks.

Also - unnecessarily gendered title?

I was using matplotlib yesterday - it is pretty rough. The style sheets will be helpful to make the colors better - but I also struggled with generating line thick enough to be meaningful, showing out enough to see the chart, and labeling data
It has its issues, but as someone who has used a Lot of MATLAB I will say the built-in colormaps of matplotlib are far superior. For personal stuff it's fine to rely on file exchange colormaps, but I feel less great about using external code in my academic and government work environments.
My quick and dirty trick is to set an alpha=0.8 to soften the default colors. It always looks better.
Indeed that does make charts look better. I do this for grid line:

ax.set_axisbelow(True) ax.grid(True, alpha=0.3)

I don't mind the default colormap (parula). If I'm using the color for any sort of dimension then I start to care about the colormap choices. Perceptually uniform and colorblind agnostic choices are important for any sort of publication, and arguably a starter for any sort of accessibility considerations.
Is there an experts guide to matplotlib for those who want to delve into creating sophisticated charts?
The title is "playing with", but the article is just a gallery of EXISTING stylesheets. At the bottom is a blurb about how to make your own custom one by simply copying one that exists. There's almost zero content here other than "stylesheets exist".
Why isn't this flagged? And why does this get upvotes? This a low-quality zero-content bait article. The same thing is right there in the matplotlib documentation [0]

[0] https://matplotlib.org/stable/gallery/style_sheets/style_she...

I have no affiliation and looked at both articles. It would have been nice for them to acknowledge where the plot design came from, since that’s a copy of their doc code. They did add a section on locating and applying a custom style sheet, and an introduction that read easily. That possibly enough.
I use matplotlib all the time and I didn't know about it. Maybe the documentation page is a better reference, but I'm happy the post was posted so I could learn about the existence of these stylesheets. I'd much rather see posts like this than links to twitter threads