config_context¶
yohou.plotting.config_context(*, resampler=None, resampler_n_shown_samples=None, resampler_downsampler=None, resampler_gap_handler=None, resampler_trace_prefix_suffix=None, resampler_show_mean_aggregation_size=None, line_shape=None)
¶
Context manager to temporarily override plotting configuration.
Parameters ¶
| Name | Type | Description | Default |
|---|---|---|---|
resampler
|
bool | Literal['widget'] | None
|
Temporary resampler mode. |
None
|
resampler_n_shown_samples
|
int | None
|
Temporary number of shown samples. |
None
|
resampler_downsampler
|
AbstractAggregator | None
|
Temporary downsampling algorithm. |
None
|
resampler_gap_handler
|
AbstractGapHandler | None
|
Temporary gap handler. |
None
|
resampler_trace_prefix_suffix
|
tuple[str, str] | None
|
Temporary legend prefix/suffix. |
None
|
resampler_show_mean_aggregation_size
|
bool | None
|
Temporary aggregation size display. |
None
|
line_shape
|
str | None
|
Temporary line interpolation for every scatter line trace (one of
|
None
|
Examples ¶
>>> from yohou.plotting import config_context, get_config, set_config
>>> set_config(resampler=False)
>>> with config_context(resampler="widget"):
... assert get_config()["resampler"] == "widget"
>>> assert get_config()["resampler"] is False
>>> with config_context(line_shape="hv"):
... assert get_config()["line_shape"] == "hv"
>>> assert get_config()["line_shape"] is None
See Also ¶
set_config: Set global configuration values.get_config: Read the current configuration.