{"id":443,"library":"matplotlib-inline","title":"Matplotlib Inline Backend for Jupyter","description":"Provides an inline Matplotlib backend for Jupyter, enabling figures to display directly within the notebook interface. Current version: 0.2.1. Maintained by the IPython Development Team, with releases as needed to address updates and improvements.","status":"active","version":"0.2.1","language":"python","source_language":"en","source_url":"https://github.com/ipython/matplotlib-inline","tags":["Jupyter","Matplotlib","Inline Plotting","Data Visualization"],"install":[{"cmd":"pip install matplotlib-inline","lang":"bash","label":"Install via pip"}],"dependencies":[{"reason":"Required for plotting functionality","package":"matplotlib"},{"reason":"Required for Jupyter kernel integration","package":"ipykernel"}],"imports":[{"note":"Ensure correct import path to avoid ImportError","symbol":"configure_inline_support","correct":"from IPython.core.pylabtools import configure_inline_support"}],"quickstart":{"code":"import numpy as np\nimport matplotlib.pyplot as plt\n\n# Generate sample data\nx = np.linspace(0, 10, 100)\ny = np.sin(x)\n\n# Create a plot\nplt.plot(x, y)\nplt.title('Sine Wave')\nplt.show()","lang":"python","description":"Basic example to generate and display a sine wave plot inline within a Jupyter notebook."},"warnings":[{"fix":"Install 'matplotlib-inline' using pip: pip install matplotlib-inline","message":"Ensure that 'matplotlib-inline' is installed to enable inline plotting in Jupyter notebooks. Without this package, figures may not display inline.","severity":"breaking","affected_versions":"0.2.1"},{"fix":"Add '%matplotlib inline' at the beginning of your notebook to enable inline plotting.","message":"In some Jupyter environments, the '%matplotlib inline' magic command may still be required to enable inline plotting. If figures do not display inline, try running '%matplotlib inline' in a notebook cell before plotting.","severity":"gotcha","affected_versions":"0.2.1"},{"fix":"Install 'numpy' using pip: pip install numpy","message":"The 'numpy' package is not found. This typically occurs when numpy is not installed in the current Python environment, leading to a ModuleNotFoundError when an application or its dependencies try to import it.","severity":"breaking","affected_versions":"0.2.1"},{"fix":"Install 'numpy' using pip: pip install numpy","message":"Ensure that 'numpy' is installed. The 'ModuleNotFoundError: No module named 'numpy'' indicates that the package is missing, preventing scripts that depend on it from running.","severity":"breaking","affected_versions":"*"}],"env_vars":null,"last_verified":"2026-05-12T13:51:19.945Z","next_check":"2026-06-26T00:00:00.000Z","problems":[{"fix":"Use `%matplotlib inline` only within Jupyter Notebooks or IPython consoles. In a regular Python script, remove this line and explicitly call `plt.show()` to display plots.","cause":"The `%matplotlib inline` command is an IPython magic command and is not valid standard Python syntax outside of an IPython environment.","error":"SyntaxError: invalid syntax %matplotlib inline"},{"fix":"Install the package using pip: `pip install matplotlib-inline`. Ensure it's installed in the Python environment linked to your Jupyter or IPython setup.","cause":"The `matplotlib-inline` package is not installed in the active Python environment or the environment's `PYTHONPATH` is misconfigured.","error":"ModuleNotFoundError: No module named 'matplotlib_inline'"},{"fix":"After creating a plot, explicitly call `plt.show()`. In modern Jupyter, `%matplotlib inline` is often not strictly necessary as inline display is usually the default, but if issues persist, ensure it's in the first cell without extra spaces, and always follow plotting commands with `plt.show()` if needed.","cause":"Even with `matplotlib-inline` enabled, plots may not automatically display in Jupyter Notebooks due to specific environment configurations, older Matplotlib versions, or if `plt.show()` is not explicitly called.","error":"No plot appears!"},{"fix":"Update both Matplotlib and `matplotlib-inline` to their latest compatible versions: `pip install --upgrade matplotlib matplotlib-inline`. If the problem persists, consider creating a clean Python environment.","cause":"This error can arise from version incompatibilities between Matplotlib and `matplotlib-inline`, or issues when Matplotlib attempts to set up an interactive backend.","error":"AttributeError: module 'matplotlib' has no attribute 'interactive'"}],"ecosystem":"pypi","meta_description":null,"install_score":0,"install_tag":"stale","quickstart_score":0,"quickstart_tag":"stale","pypi_latest":null,"install_checks":{"last_tested":"2026-05-12","tag":"stale","tag_description":"widespread failures or data too old to trust","results":[{"runtime":"python:3.10-alpine","python_version":"3.10","os_libc":"alpine (musl)","variant":"default","exit_code":1,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.10-slim","python_version":"3.10","os_libc":"slim (glibc)","variant":"default","exit_code":1,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.11-alpine","python_version":"3.11","os_libc":"alpine (musl)","variant":"default","exit_code":1,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.11-slim","python_version":"3.11","os_libc":"slim (glibc)","variant":"default","exit_code":1,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.12-alpine","python_version":"3.12","os_libc":"alpine (musl)","variant":"default","exit_code":1,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.12-slim","python_version":"3.12","os_libc":"slim (glibc)","variant":"default","exit_code":1,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.13-alpine","python_version":"3.13","os_libc":"alpine (musl)","variant":"default","exit_code":1,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.13-slim","python_version":"3.13","os_libc":"slim (glibc)","variant":"default","exit_code":1,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.9-alpine","python_version":"3.9","os_libc":"alpine (musl)","variant":"default","exit_code":1,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.9-slim","python_version":"3.9","os_libc":"slim (glibc)","variant":"default","exit_code":1,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null}]},"quickstart_checks":{"last_tested":"2026-04-23","tag":"stale","tag_description":"widespread failures or data too old to trust","results":[{"runtime":"python:3.10-alpine","exit_code":1},{"runtime":"python:3.10-slim","exit_code":1},{"runtime":"python:3.11-alpine","exit_code":1},{"runtime":"python:3.11-slim","exit_code":1},{"runtime":"python:3.12-alpine","exit_code":1},{"runtime":"python:3.12-slim","exit_code":1},{"runtime":"python:3.13-alpine","exit_code":1},{"runtime":"python:3.13-slim","exit_code":1},{"runtime":"python:3.9-alpine","exit_code":1},{"runtime":"python:3.9-slim","exit_code":1}]}}