{"id":5140,"library":"bqplot","title":"bqplot","description":"bqplot is a 2-D visualization system for Jupyter, based on the constructs of the Grammar of Graphics. It provides interactive plotting for Jupyter notebooks, leveraging d3.js and ipywidgets. Every component of a bqplot plot is an interactive widget, allowing seamless integration with other Jupyter interactive widgets to create integrated GUIs. It offers both a flexible object model API and a concise pyplot-like API similar to Matplotlib. The library is actively maintained with frequent patch releases, and a major version (0.13.0) is in pre-release, indicating ongoing development.","status":"active","version":"0.12.45","language":"en","source_language":"en","source_url":"https://github.com/bqplot/bqplot","tags":["jupyter","ipywidgets","plotting","visualization","interactive","d3.js","data science"],"install":[{"cmd":"pip install bqplot","lang":"bash","label":"PyPI (recommended)"},{"cmd":"conda install -c conda-forge bqplot","lang":"bash","label":"Conda"}],"dependencies":[{"reason":"Core dependency for interactive Jupyter functionality. Version 0.12.x requires ipywidgets < 8.0.","package":"ipywidgets","optional":false},{"reason":"Used for reactive data attributes in plot components.","package":"traitlets","optional":false},{"reason":"Extension for traitlets to handle NumPy types.","package":"traittypes","optional":false},{"reason":"Commonly used for data generation and manipulation.","package":"numpy","optional":false},{"reason":"Commonly used for data manipulation.","package":"pandas","optional":false},{"reason":"Will be a dependency for WebGL marks in bqplot 0.13.x; currently experimental/separate for 0.12.x.","package":"bqplot-gl","optional":true}],"imports":[{"note":"The Matplotlib-inspired, context-based API for quick plotting.","symbol":"pyplot","correct":"from bqplot import pyplot as plt"},{"note":"For the object model API, where components are explicitly constructed.","symbol":"Figure","correct":"from bqplot import Figure, LinearScale, Axis, Lines"}],"quickstart":{"code":"import numpy as np\nfrom bqplot import pyplot as plt\n\n# Generate some data\nsize = 100\nnp.random.seed(0)\nx_data = np.arange(size)\ny_data = np.cumsum(np.random.randn(size) * 100.0)\n\n# Create a figure and plot\nfig = plt.figure(title=\"My First Plot\")\nline_plot = plt.plot(x_data, y_data)\n\n# Display the plot (in a Jupyter environment, this might be implicit or use display(fig))\n# For explicit display, you'd use from IPython.display import display; display(fig)\nfig","lang":"python","description":"This quickstart demonstrates creating a simple line chart using bqplot's pyplot API, which is similar to Matplotlib's `pyplot`. It generates random data, creates a figure, plots the data, and displays the interactive chart in a Jupyter environment."},"warnings":[{"fix":"For bqplot 0.12.x, ensure `ipywidgets` is installed as `pip install 'ipywidgets>=7,<8'`. To use `ipywidgets 8+`, you will need to upgrade to bqplot 0.13.x (when released, currently in pre-release) or newer.","message":"The `bqplot` 0.12.x series (including 0.12.45) is explicitly compatible with `ipywidgets < 8.0`. Upgrading `ipywidgets` to version 8.0 or higher while using `bqplot` 0.12.x will lead to broken plots and runtime errors.","severity":"breaking","affected_versions":"bqplot < 0.13.0"},{"fix":"After `pip install bqplot`, also run `jupyter labextension install @jupyter-widgets/jupyterlab-manager bqplot` and restart JupyterLab. This step is typically not needed for JupyterLab >=3 with `ipywidgets 7.6+`.","message":"For users of JupyterLab <= 2, an additional manual installation of JupyterLab extensions is often required for `bqplot` to render correctly. Without these, plots may appear as text representations (e.g., `<bqplot.figure.Figure object at 0x...>)` instead of interactive visualizations.","severity":"gotcha","affected_versions":"All bqplot versions with JupyterLab <= 2"},{"fix":"For WebGL marks, install `bqplot-gl` (`pip install bqplot-gl`) and import marks like `ScatterGL` from `bqplot_gl` directly.","message":"In the upcoming `bqplot` 0.13.x release, WebGL-based marks (e.g., `ScatterGL`) are being moved to a separate `bqplot-gl` package. Direct imports of these from `bqplot` will likely be deprecated or removed, requiring explicit imports from `bqplot_gl` and its installation.","severity":"deprecated","affected_versions":"bqplot >= 0.13.0a0"}],"env_vars":null,"last_verified":"2026-04-13T00:00:00.000Z","next_check":"2026-07-12T00:00:00.000Z"}