Overlay#

Download this notebook from GitHub (right-click to download).


Title
Overlay Container
Dependencies
Bokeh
Backends
Bokeh
Matplotlib
Plotly
import numpy as np
import holoviews as hv
hv.extension('bokeh')

A Overlay is a collection of HoloViews objects that are related in some way, to be displayed simultaneously, overlaid in the same space. Like Layout and unlike other containers such as HoloMap , GridSpace and NdOverlay a Overlay is not dictionary like: it holds potentially heterogeneous types without any dimensioned keys.

A Overlay cannot contain any other container type other than NdOverlay but can contain any HoloViews elements. See Building Composite Objects for more details on how to compose containers. It is best to learn about Overlay and Layout together as they are very closely related objects that share many core concepts.

Overlay is a heterogeneous collection#

You can build a Overlay between any two HoloViews objects (which can have different types) using the * operator:

xvals = [0.1* i for i in range(100)]
curve =  hv.Curve((xvals, [np.sin(x) for x in xvals]))
scatter =  hv.Scatter((xvals[::5], np.linspace(0,1,20)))
curve * scatter

In this example, we have a Overlay composed of a Curve element and a Scatter element.

For more information about both Overlay and Layout, see the Composing_Elements user guide.

This web page was generated from a Jupyter notebook and not all interactivity will work on this website. Right click to download and run locally for full Python-backed interactivity.

Download this notebook from GitHub (right-click to download).