Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Bug docstring for set_matplotlib_formats

Open
#44 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
48/100
Issue type
Documentation
Clarity
Mostly clear
Activity status
Stale
Tech stack
jupyter-notebook, python

Research direction

Start at matplotlib_inline.backend_inline.set_matplotlib_formats and reproduce the documented example with matplotlib 3.10.5. Compare the docstring's quality argument with the shown pil_kwargs workaround; done means the documentation accurately describes supported arguments and the example no longer leads users to the reported TypeError.

Written by the indexing model from the issue text.

Description

For matplotlib_inline.__version__ == '0.1.7' (matplotlib.__version__ == '3.10.5')

from matplotlib_inline.backend_inline import set_matplotlib_formats
help(set_matplotlib_formats)

print:

...
    For example, this enables PNG and JPEG output with a JPEG quality of 90%::

        In [1]: set_matplotlib_formats('png', 'jpeg', quality=90)

But:

import matplotlib.pyplot as plt
from matplotlib_inline.backend_inline import set_matplotlib_formats

set_matplotlib_formats('png', 'jpeg', quality=90)

fig, ax = plt.subplots()
plt.show()

Cause:

...
TypeError: FigureCanvasAgg.print_png() got an unexpected keyword argument 'quality'
...
TypeError: FigureCanvasAgg.print_jpg() got an unexpected keyword argument 'quality'

Workaround, probably use:

set_matplotlib_formats('png', 'jpeg', pil_kwargs=dict(quality=10))

or

%config InlineBackend.print_figure_kwargs = {'pil_kwargs': {'quality' : 90, \
                                                            'optimize': True}}
Dominant language
Jupyter Notebook
Stars
31
Forks
39
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

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 ipython/matplotlib-inline

All issues in ipython/matplotlib-inline

Similar issues

More Data Visualization issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.