Working in Interactive Mode in Matplotlib

By Hemanta Sundaray on 2022-04-12

Matplotlib can be used in interactive or non-interactive mode. In the interactive mode, the graph display gets updated after each statement.

We can set the interactive mode ON using the following steps:

Step-1

Import matplotlib & pyplot libraries:

import matplotlib as mpl

import matplotlib.pyplot as plt

Step-2

Set the interactive mode to ON.

plt.ion()

We can check the status of the interactive mode using the following command:

mpl.is_interactive()

We get the output as True.

Join the Newsletter