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

`plt.ioff()` not preventing automatic figure generation in jupyter

Open
#21 0 comments 0 reactions 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
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
jupyter, jupyter-notebook, python
Domain
backend

Research direction

Start by reproducing the example using plt.ioff() or plt.interactive(False) in both Jupyter Lab and the classic notebook, then compare it with explicitly running %matplotlib inline. Trace the inline backend behavior around automatic figure display; done means figures are not displayed automatically without requiring the magic command.

Written by the indexing model from the issue text.

Description

Using plt.interactive(False) or plt.ioff() in Jupyter (Lab and classic notebook) does not seem to prevent automatic figure generation, unless the magic %matplotlib inline in run first, even though the inline backend is the default.

Example
import matplotlib.pyplot as plt

plt.ioff()

fig, ax = plt.subplots()
a = 0

The figure still appears automatically under the cell.
Screenshot at 2022-08-29 14-25-08

Note that

Explicitly running %matplotlib inline blocks figure creation (even though inline is the default activated backend in Jupyter):
Screenshot at 2022-08-29 14-26-48

Originally posted in https://github.com/matplotlib/matplotlib/issues/23766

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 Backend & API Design issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.