matplotlib / matplotlib/ipympl

Ability to configure defaults for `Canvas`

Open
#540 0 comments 1 reaction 0 assignees View on GitHub
enhancement
Dominant language
Jupyter Notebook
Stars
1.7k
Forks
234
PR merge metrics
No merged PRs in 30d

Description

As shown in the [example notebook,](https://github.com/matplotlib/ipympl/blob/main/docs/examples/full-example.ipynb) it is possible to configure the appearance of the `Canvas` widget by setting some attributes on it.
A lot of these attributes are settings that I would like to configure in the same way for all figures. It would be very convenint if there was some way to set the default values of these attributes before creating plots (similar to `matplotlib.rcParams`).

I tried changing the traitlet definitions directly (i.e. `Canvas.header_visible.default_value = False`), but apparently the traitlets cache the original default values somewhere and ignore the change to `default_value`.

Contributor guide

Open the contributing guide

Research direction

Start with docs/examples/full-example.ipynb and the Canvas traitlet definitions mentioned in the issue. Identify how attributes such as header_visible are currently configured, then determine a way to set defaults before plots are created; done means newly created figures inherit those defaults without per-Canvas assignments.

Written by the indexing model from the issue text.

Assessment

Tech stack
jupyter-notebook
Domain
frontend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.