Ability to configure defaults for `Canvas`

Open
#540 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

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

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.

Description

enhancement

As shown in the example notebook, 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.

Dominant language
Jupyter Notebook
Stars
1.7k
Forks
234
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from matplotlib/ipympl

All issues in matplotlib/ipympl

Similar issues

More Web Dev issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.