{"id":5254,"library":"hvplot","title":"hvplot","description":"hvplot is a high-level plotting API for the PyData ecosystem built on HoloViews. It provides a familiar API, similar to Pandas' `.plot()` method, to generate interactive and compositional plots from various data structures like Pandas DataFrames, Xarray DataArrays, Dask, GeoPandas, and Polars. It supports Bokeh (default), Matplotlib, and Plotly backends and is actively developed with frequent patch releases and minor versions.","status":"active","version":"0.12.2","language":"en","source_language":"en","source_url":"https://github.com/holoviz/hvplot","tags":["plotting","visualization","holoviz","pandas","xarray","geospatial","interactive","data science"],"install":[{"cmd":"pip install hvplot","lang":"bash","label":"Using pip"},{"cmd":"conda install conda-forge::hvplot","lang":"bash","label":"Using Conda"}],"dependencies":[{"reason":"hvplot is built on HoloViews, requiring it as a core dependency for plot generation and backend management.","package":"holoviews"},{"reason":"Widely used as a primary data source for hvplot's DataFrame-like plotting API.","package":"pandas"},{"reason":"The default and most commonly used interactive plotting backend for hvplot.","package":"bokeh"},{"reason":"Provides .hvplot accessors for working with labeled multi-dimensional arrays.","package":"xarray","optional":true},{"reason":"Enables plotting of larger-than-memory datasets by integrating with Dask DataFrames.","package":"dask","optional":true},{"reason":"Adds geospatial plotting capabilities and accessors for GeoDataFrames.","package":"geopandas","optional":true},{"reason":"Optional backend for generating static plots.","package":"matplotlib","optional":true},{"reason":"Optional backend for generating interactive plots with Plotly.","package":"plotly","optional":true},{"reason":"Recommended for efficiently visualizing large datasets, especially for rasterization.","package":"datashader","optional":true}],"imports":[{"note":"Imports the hvplot accessor onto the respective data structures, making the .hvplot method available. This also loads the Bokeh extension by default.","symbol":".hvplot accessor","correct":"import hvplot.pandas\n# or hvplot.xarray, hvplot.dask, etc."},{"note":"Plotting extensions (backends) are loaded via `hvplot.extension()` after importing a data accessor, not directly as a top-level module.","wrong":"import hvplot.matplotlib","symbol":"hvplot.extension","correct":"import hvplot.pandas\nhvplot.extension('matplotlib')"},{"note":"While `.show()` might implicitly work in some environments, for explicit display outside of notebooks or for more control, `hvplot.show()` (or `bokeh.plotting.show(hv.render(plot_object))` from HoloViews/Bokeh) is the correct pattern.","wrong":"plot_object.show()","symbol":"hvplot.show","correct":"from hvplot import show\n# ... create plot ...\nshow(plot_object)"}],"quickstart":{"code":"import pandas as pd\nimport numpy as np\nimport hvplot.pandas # noqa\n\ndf = pd.DataFrame(\n    np.random.randn(100, 4), \n    index=pd.date_range('1/1/2000', periods=100),\n    columns=list('ABCD')\n).cumsum()\n\ndf.hvplot.line(y='A', title='Interactive Line Plot of Column A')","lang":"python","description":"This quickstart demonstrates how to import hvplot for Pandas DataFrames and create a basic interactive line plot using the familiar `.hvplot` accessor."},"warnings":[{"fix":"Replace `hover_formatters` with `hover_tooltips`. For DuckDB objects, ensure you import `hvplot.duckdb` to enable the accessor: `import hvplot.duckdb`.","message":"The `hover_formatters` argument is deprecated in favor of `hover_tooltips`. Additionally, passing `DuckDB` objects directly to `hvplot.plotting.plot` is discouraged; users should instead `import hvplot.duckdb` to enable proper integration.","severity":"deprecated","affected_versions":"0.12.0+"},{"fix":"Ensure Bokeh and HoloViews are up-to-date. In problematic Jupyter environments, a page refresh might resolve it. For external IDEs, consider rendering the plot to an HTML file or serving it explicitly using `hvplot.show()` (which wraps HoloViews/Bokeh rendering utilities).","message":"hvplot outputs, especially with Bokeh or Plotly backends, may not display immediately or at all in some IDEs (like PyCharm) or Jupyter environments (requiring a page refresh) due to their limited notebook integration or specific HoloViews/Bokeh version incompatibilities.","severity":"gotcha","affected_versions":"All versions, particularly with older HoloViews/Bokeh combinations (e.g., HoloViews 1.18.1 with Bokeh 3.3.2)."},{"fix":"For full interactivity and broader feature support, prefer the Bokeh or Plotly backends. If Matplotlib is required, consult the documentation for supported plot types and options, and `.compute()` Dask DataFrames before plotting.","message":"Some advanced plotting options, such as `subplots=True` for `hist` or `hexbin` plots, may have limited or no support with the Matplotlib backend. When plotting Dask DataFrames with Matplotlib, explicit computation (`.compute()`) might be necessary to avoid errors or blank plots.","severity":"gotcha","affected_versions":"All versions"},{"fix":"If upgrading from `<0.11.0`, be aware that existing code for manual projection with `tiles=True` might now be redundant or conflict with the new automatic behavior. Review and potentially remove manual projection steps for `tiles=True` plots.","message":"For geographic plots with `tiles=True`, `hvplot>=0.11.0` automatically converts latitude/longitude to Web Mercator. Prior to `v0.11.0`, manual projection using utilities like `holoviews.util.transform.lon_lat_to_easting_northing` was often required.","severity":"breaking","affected_versions":"<0.11.0 (requires manual projection), 0.11.0+ (automatic projection)"},{"fix":"Consider overlaying a scatter plot (`.hvplot.scatter()`) to show individual data points. Ensure Bokeh and HoloViews are up-to-date, as some rendering issues (e.g., with WebGL) might be fixed in newer versions. Filtering out `NaN` values or interpolating might also be options depending on data requirements.","message":"Line plots of time series or sparse data with `NaN` values may exhibit 'disappearing lines' when zooming in, especially if single data points are surrounded by `NaN`s, as a line requires at least two points. This can sometimes be exacerbated by WebGL rendering in older Bokeh versions.","severity":"gotcha","affected_versions":"All versions, potentially worse with older Bokeh/HoloViews"}],"env_vars":null,"last_verified":"2026-04-13T00:00:00.000Z","next_check":"2026-07-12T00:00:00.000Z"}