Plot Configuration
scikit-explain provides a seaborn-style configuration API for customizing plots. Set display names, units, colors, and theme options once — they apply to all subsequent plot calls.
API Reference
- class skexplain.plot.config.PlotConfig(figsize: Tuple[float, float] | None = None, n_columns: int | None = None, wspace: float | None = None, hspace: float | None = None, base_font_size: int = 12, display_feature_names: Dict[str, str] | None = None, display_units: Dict[str, str] | None = None, feature_colors: Dict[str, str] | None = None, style: str = 'ticks', palette: str | None = None, font_scale: float = 1.0, rc: dict | None = None, add_hist: bool = True, to_probability: bool | None = None, num_vars_to_plot: int = 10)[source]
Global plot configuration.
Set once on ExplainToolkit via
set_plotting_config(), applies to all subsequent plot calls. Per-call arguments override these defaults.- figsize
Default figure size in inches (width, height).
- Type:
tuple of (float, float), optional
- n_columns
Number of columns in multi-panel layouts.
- Type:
int, optional
- wspace
Width spacing between subplots.
- Type:
float, optional
- hspace
Height spacing between subplots.
- Type:
float, optional
- base_font_size
Base font size for all text elements.
- Type:
int, default=12
- display_feature_names
Maps internal feature names to display-friendly names. E.g.,
{"dwpt2m": "$T_{d}$"}.- Type:
dict, optional
- display_units
Maps feature names to unit strings. E.g.,
{"dwpt2m": "$^\circ$C"}.- Type:
dict, optional
- feature_colors
Maps feature names to colors for color-coding groups.
- Type:
dict, optional
- style
Seaborn style passed to
sns.set_theme(style=...). Options: “darkgrid”, “whitegrid”, “dark”, “white”, “ticks”.- Type:
str, default=”ticks”
- palette
Seaborn color palette.
- Type:
str, optional
- font_scale
Font scaling factor.
- Type:
float, default=1.0
- rc
Matplotlib rcParams overrides passed to
sns.set_theme(rc=...).- Type:
dict, optional
- add_hist
Whether to add background histograms on ALE/PD plots.
- Type:
bool, default=True
- to_probability
If True, multiply values by 100 for probability display.
- Type:
bool, optional
- num_vars_to_plot
Default number of top features to plot in importance plots.
- Type:
int, default=10
- add_hist: bool = True
- base_font_size: int = 12
- display_feature_names: Dict[str, str] | None = None
- display_units: Dict[str, str] | None = None
- feature_colors: Dict[str, str] | None = None
- classmethod field_names()[source]
Return list of valid config field names.
- figsize: Tuple[float, float] | None = None
- font_scale: float = 1.0
- hspace: float | None = None
- n_columns: int | None = None
- num_vars_to_plot: int = 10
- palette: str | None = None
- rc: dict | None = None
- style: str = 'ticks'
- to_probability: bool | None = None
- to_seaborn_kws()[source]
Convert theme settings to seaborn_kws dict for PlotStructure.
- wspace: float | None = None