Bug docstring for set_matplotlib_formats
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
- Domain
- data-visualization, documentation
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
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from ipython/matplotlib-inline
-
Support animations Open
Difficulty 3/5 1-2 days Newbie friendliness 48/100
ipython/matplotlib-inline#61 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
ipython/matplotlib-inline#59 ·
-
Publish changelog Open
Difficulty 3/5 1-2 days Newbie friendliness 35/100
ipython/matplotlib-inline#57 · 1 reaction ·
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
ipython/matplotlib-inline#54 · 1 comment ·
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
ipython/matplotlib-inline#43 ·
All issues in ipython/matplotlib-inline
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
scope: charts status: waiting for maintainer
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
chore P3 plotly-internal size: 3 task
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Live-Charts/LiveCharts2#2394 ·
-
Urgent request: Due to vulnerabilities move to API version 12.6.1 (12.6.2 eventually) or 13.1.1 Open
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
jbkunst/highcharter#849 ·