I'm trying to add labels to a grouped hvplot barchart.
My example dataframe has the following structure:
import pandas as pd
import numpy as np
import holoviews as hv
import hvplot.pandas
hv.extension('bokeh')
df = pd.DataFrame({'A' : ['A','B','A','B','A','B'],
'B' : [1,1,2,2,3,3],
'C' : list((range(20,26)))
})
The bar chart is created with the following code:
bar = df.hvplot.bar(x='B', y='C', by='A')
bar
I tried to add labels according to this and this SO questions:
labels = hv.Labels(data=df, kdims=['B','A'],vdims='C')
labels
But an overlay of both plots
bar * labels
results in an error, though the dimensions seem to be the same for me.
ValueError: all the input arrays must have same number of dimensions
:Overlay
.Bars.I :Bars [B,A] (C)
.Labels.I :Labels [B,A] (C)
Any hint to the solution is appreciated. Thank you!