Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plot style incoherent with default plot params #1430

Open
JoElfner opened this issue Sep 15, 2020 · 0 comments
Open

Plot style incoherent with default plot params #1430

JoElfner opened this issue Sep 15, 2020 · 0 comments
Labels
visualization Relating to plotting

Comments

@JoElfner
Copy link

Having consistent plot styles throughout your documents is, at least in my field, very important. My usual approach is to load a pre-defined rcParams style sheet at the beginning of each relevant python script. This results in consistent styles for most plotting tools, such as matplotlib, seaborn, pandas.plotting, plotly, etc.
But in shap, the style of the plots, most specifically font sizes, tick params and spines are incoherent with underlying default parameters, such as matplotlib rcParams. Plot styles are set explicitly in each plot. This makes it really hard to set your own consistent plot style to all plots. The, in my opinion, only viable way to do so, is to fork shap and comment out the explicit plot style definitions.

I'd propose introducing an additional argument, such as style, which can either take style='shap' (default) resulting in the current style, style='matplotlib' using the rcParams or any style sheet as in the matplotlib doc. The styles could be applied easily using a context manager.
Besides having flexibility to easily switch styles, this has the advantage that there can be a single shap style sheet, which can be loaded from within all plotting functions.
If you are interested, I could open a PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
visualization Relating to plotting
Projects
None yet
Development

No branches or pull requests

2 participants