API#
Utilities#
|
Print a docstring with all valid options which apply to the plot type. |
|
Helper utility used to load hvPlot/HoloViews extensions and control the notebook environment. |
alias of |
|
|
Helper used to set HoloViews display options. |
|
Renders the HoloViews object to the corresponding object in the specified backend, e.g. a Matplotlib or Bokeh figure. |
|
Saves the supplied object to file. |
|
Starts a Bokeh server and displays the plot in a new tab. |
Plotting#
hvPlot
/ .hvplot
#
hvPlot’s plotting API is most often invoked by installing the hvplot
namespace on a data source via a special import:
import pandas as pd
import hvplot.pandas # noqa
df = pd.DataFrame()
df.hvplot.scatter()
# or
df.hvplot(kind='scatter')
Under the hood, these special imports like import hvplot.pandas
register an accessor that returns an instance of an hvPlotBase
class. Tabular-like data sources rely on the hvPlotTabular
class and gridded-like sources on hvPlot
(subclass of hvPlotTabular
extended with methods like image
):
hvPlotTabular
: cuDF, Dask, Fugue, Ibis, Pandas, StreamzhvPlotTabularDuckDB
: DuckDBhvPlotTabularPolars
: PolarshvPlot
: Xarray
Instead of using the hvplot
namespace, one can directly generate hvPlot plots with these classes:
import pandas as pd
from hvplot import hvPlot
df = pd.DataFrame()
hvPlot(df).scatter()
# or
hvPlot(df)(kind='scatter')
This section documents all the plotting methods of the hvPlot
class, which as described above are also available via the hvplot
namespace.
Common#
|
The area plot can be used to color the area under a line or to color the space between two lines. |
|
A vertical bar plot |
|
A horizontal bar plot |
|
The box plot gives you a visual idea about the locality, spread and skewness of numerical data through their quartiles. |
|
A bivariate, density plot uses nested contours (or contours plus colors) to indicate regions of higher local density. |
|
The 'dataset' wraps a tabular or gridded dataset and can be further transformed and annotated via methods from HoloViews. |
|
Alias of |
|
errorbars provide a visual indicator for the variability of the plotted data on a graph. |
|
heatmap visualises tabular data indexed by two key dimensions as a grid of colored values. |
|
The hexbin plot uses hexagons to split the area into several parts and attribute a color to it. |
|
A histogram displays an approximate representation of the distribution of continuous data. |
|
The Kernel density estimate (kde) plot shows the distribution and spread of the data. |
|
Labels plot. |
|
The line plot connects the points with a continuous curve. |
|
The ohlc plot visualizes the open, high, low and close prices of stocks and other assets. |
|
LineString and LineRing plot for geopandas dataframes. |
|
A points plot visualizes positions in a 2D space. |
|
Polygon plot for geopandas dataframes. |
|
The scatter plot visualizes your points as markers in 2D space. |
|
The step plot connects the points with piece-wise constant curves. |
|
Displays a 'table'. |
|
vectorfield visualizes vectors given by the (x `, `y) starting point, a magnitude (mag) and an angle. |
|
violin plots are similar to box plots, but they provide a better sense of the distribution of data. |
Gridded#
|
Line contour plot |
|
Filled contour plot |
|
Image plot |
|
QuadMesh plot |
|
RGB plot |
plotting
module#
hvPlot’s structure is based on Pandas’ plotting API and as such provides special plotting functions in the hvplot.plotting
module.
|
Generate a plot of Andrews curves, for visualising clusters of multivariate data. |
|
Lag plot for time series. |
|
Parallel coordinates plotting. |
|
Scatter matrix of numeric columns. |
NetworkX#
The hvPlot NetworkX plotting API is meant as a drop-in replacement for the networkx.draw
methods.
Note
Please chime in this issue if you have opinions about NetworkX plotting API in hvPlot.
|
Draw the graph G using hvPlot. |
|
Draw a networkx graph. |
|
Draw networkx graph nodes. |
|
Draw networkx graph edges. |
|
Draw networkx graph node labels. |
|
Draw networkx graph with circular layout. |
|
Draw networkx graph with circular layout. |
|
Draw networkx graph with random layout. |
|
Draw networkx graph with planar layout. |
|
Draw networkx graph with shell layout. |
|
Draw networkx graph with spectral layout. |
|
Draw networkx graph with spring layout. |
Explorer#
The explorer interface can easily be created from the hvPlot
/ .hvplot
namespace:
|
The explorer plot allows you to interactively explore your data. |
It is also available from the top-level explorer
function:
|
Explore your data and design your plot via an interactive user interface. |
Calling the explorer
function/method returns an hvPlotExplorer
object:
|
|
Return the plot as a HoloViews object. |
|
|
Return a string representation that can be easily copy-pasted in a notebook cell to create a plot from a call to the .hvplot accessor, and that includes all the customized settings of the explorer. |
|
Save the plot to file. |
|
Serves the object or adds it to the configured pn.state.template if in a panel serve context, writes to the DOM if in a pyodide context and returns the Panel object to allow it to display itself in a notebook context. |
Return a dictionary of the customized settings. |
|
|
Starts a Bokeh server and displays the Viewable in a new tab. |