Do these 3 things before closing this tab:
1Clear out junk files and repair common Windows errors2Fix the driver behind crashes, sound loss and screen glitches3Repair Windows errors before they cause bigger problemsUse %matplotlib inline in an IPython-backed Jupyter notebook to display Matplotlib plots as static output beneath the cell that creates them. It is a notebook magic, not standard Python syntax for a regular .py script. If you need to pan, zoom, or otherwise interact with a plot, use the separate ipympl widget backend in a supported notebook instead.
What %matplotlib inline does
The %matplotlib inline magic selects Matplotlib’s inline notebook backend. When a plotting cell runs, its figure is rendered as notebook output. The output is static: changing data or code in a later cell does not change an already rendered plot. Rerun the plotting cell to create a new output. Matplotlib also notes that the default inline backend adjusts the displayed figure to a tight box around the artists in it. Matplotlib’s image tutorial describes inline display and its limits; its figure introduction covers the default backend’s static behavior.
Display a plot inline
Enter the magic in a notebook cell, then create and plot data with Matplotlib’s usual pyplot interface:
%matplotlib inline
import matplotlib.pyplot as plt
fig, ax = plt.subplots()
ax.plot([1, 2, 3], [1, 4, 9])
Run the cell to display the figure below it. The fig, ax = plt.subplots() and ax.plot(...) pattern is also used in Matplotlib’s getting-started guide. The magic is specific to IPython-style environments; do not paste it into a regular Python script, where it is not valid Python syntax.
The Tool Desk
Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →#1 Best Overall
Choose inline or interactive display
| What you need | Use | Important detail |
|---|---|---|
| A chart embedded beneath a notebook cell | %matplotlib inline |
Static output; rerun the plotting cell to update it. |
| Notebook pan, zoom, or other figure interaction | Install ipympl and activate %matplotlib widget or %matplotlib ipympl |
Requires a supported frontend and the separate package. |
| A plot in a script or GUI application | Select a suitable Matplotlib GUI backend and use the display workflow for that environment | Inline magic is a notebook/IPython workflow; backend behavior depends on the environment. |
Matplotlib’s ipympl documentation shows the interactive widget backend and supported notebook environments. For current notebook-version guidance, Matplotlib associates %matplotlib widget with ipympl in JupyterLab or Notebook 7 and newer; for Notebook versions below 7 or nbclassic, its guidance identifies %matplotlib notebook as the older interactive option. Check the frontend and version you actually use before choosing that legacy magic. Matplotlib’s backend guidance distinguishes these options.
Install and activate the interactive alternative
If you need an interactive notebook plot, install ipympl in the environment used by the notebook. The project documents both pip and conda-forge installation:
pip install ipympl
conda install -c conda-forge ipympl
Then select the widget backend in a notebook cell:
%matplotlib widget
You can also use %matplotlib ipympl. If the magic is unrecognized or the widget does not render, confirm that the package is installed in the notebook’s active environment and that the frontend supports it; installation in a different Python environment will not enable it for the current kernel. See the ipympl setup instructions.
What a Matplotlib backend means
A backend connects Matplotlib’s figures to a mechanism that renders or displays them. In an ordinary notebook workflow, you select the display behavior with an IPython magic such as %matplotlib inline; you do not need to write a backend yourself. Backend implementation is relevant when building a custom integration, not for displaying a routine notebook chart. Matplotlib’s backend documentation explains the interface.
Quick wins for a faster PC:
Clear out junk files and repair common Windows errorsFree Scan →Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Repair Windows errors before they cause bigger problemsFix Now →Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




