I’m creating a panel app and using a holoviews Overlay to display a few curves. I could also like to incorporate a filled area graph / filled-between graph. I found the bokeh.models.Band (alias for bokeh.models.annotations.geometry.Band) from the bokeh side. There’s also filled area plots in plotly, namely the go.Scatter with a fill or fillgradient defined.
My previous curves are made with Bokeh using df.hvplot.scatter(), using the import hvplot.pandas monkeypatching API and pandas DataFrames. Seems that they’re holoviews.element.chart.Curve objects in the overlay.items().
How would you create a filled area plot in holoviews and add it to an existing Overlay?
Perfect! I was simply searching for “Band” in the holoviews and hvplot source code and as I could not find any matches I thought it might not be supported. I’ll check out which one of them would be more suitable for me Thanks @Hoxbro !
Small documentation related question. The hv.Area docs say:
For full documentation and the available style and plot options, use hv.help(hv.Area).
I run it in IPython shell and get:
>>> hv.help(hv.Area)
Traceback (most recent call last):
File "<console>", line 1, in <module>
File "/path/to/venv/lib/python3.12/site-packages/holoviews/__init__.py", line 163, in help
info = Store.info(obj, ansi=ansi, backend=backend, visualization=visualization,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/path/to/venv/lib/python3.12/site-packages/holoviews/core/options.py", line 1257, in info
info = InfoPrinter.info(obj, ansi=ansi, backend=backend,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/path/to/venv/lib/python3.12/site-packages/holoviews/core/pprint.py", line 145, in info
backend_registry = cls.store.registry.get(backend, {})
^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'registry'
This is the hv.help(hv.Area) output for future Googlers who are not using Jupyter Notebooks:
Parameters of 'Area'
====================
Parameters changed from their default values are marked in red.
Soft bound values are marked in cyan.
C/V= Constant/Variable, RO/RW = ReadOnly/ReadWrite, AN=Allow None
Name Value Type Bounds Mode
group 'Area' String C RW
label '' String C RW
cdims {} Dict V RW
kdims [Dimension('x')] List (1, 2) V RW
vdims [Dimension('y')] List (1, None) V RW
extents (None, None, None, None) Tuple V RW
datatype ['dataframe', 'dictionary', 'grid', '... List (0, None) V RW
Parameter docstrings:
=====================
group: A string describing the data wrapped by the object.
label: Optional label describing the data, typically reflecting where
or how it was measured. The label should allow a specific
measurement or dataset to be referenced for a given group.
cdims: The constant dimensions defined as a dictionary of Dimension:value
pairs providing additional dimension information about the object.
Aliased with constant_dimensions.
kdims: The key dimension(s) of a Chart represent the independent
variable(s).
vdims: The value dimensions of the Chart, usually corresponding to a
number of dependent variables.
extents: Allows overriding the extents of the Element in 2D space defined
as four-tuple defining the (left, bottom, right and top) edges.
datatype: A priority list of the data types to be used for storage
on the .data attribute. If the input supplied to the element
constructor cannot be put into the requested format, the next
format listed will be used until a suitable format is found (or
the data fails to be understood).