Skip to content

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

@nvaytet

Description

@nvaytet

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 matplotlib/matplotlib#23766

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions