thebeat icon indicating copy to clipboard operation
thebeat copied to clipboard

Handling of matplotlib styles by thebeat

Open YannickJadoul opened this issue 1 year ago • 0 comments

Following up on #66: matplotlib behaves somewhat unpredictable if the figure creation, plotting, and/or showing/saving happen in different style contexts. For example, the current style's figure.figsize seems to be accessed upon the creation of a Figure, colors and other properties of lines during the plotting of those lines, default DPI to save a figure during savefig, etc.

My suggestion would be to kick out all the style= parameters from our plotting functionality and teach users to use plt.style.use(...) and plt.style.context(...) in the docs and examples. It would clean up our code, it would not really change much for the users, and we'd probably be using matplotlib more correctly.

Plus, it would allow the modern seaborn styles to be used with thebeat: seaborn does not have its new styles as matplotlib styles anymore, and provides sns.set_style() or sns.axes_style instead of going through plt.style: https://seaborn.pydata.org/tutorial/aesthetics.html

Furthermore, thebeat's default style (in most places) is now the old seaborn-v0_8 style, and users cannot tell thebeat to not override the style (see #44).

YannickJadoul avatar Jan 07 '24 19:01 YannickJadoul