ipython / ipython/matplotlib-inline

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

Abierto
#21 0 comentarios 0 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
Jupyter Notebook
Estrellas
31
Forks
39
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

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

```python
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](https://user-images.githubusercontent.com/39047984/187201512-533fe915-df24-4e97-a038-cadacab043fc.png)

### 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](https://user-images.githubusercontent.com/39047984/187200761-345dbcd9-e5dd-4537-ba4f-20a1fc7fb24a.png)

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

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.