79493192

Date: 2025-03-07 18:32:36
Score: 1
Natty:
Report link

OK - so this sort of works but gives me double entries in the box plot legend ...

enter image description here

import holoviews as hv
import hvplot.pandas
import pandas as pd

data = pd.read_csv('https://raw.githubusercontent.com/ChrisWalshaw/DataViz/master/Data/Products/DailySales.csv', index_col=0)
data.index = pd.to_datetime(data.index)
print(data.head())

selected = ['A', 'F', 'L']

plot1 = data[selected].hvplot.line(
    frame_height=300, frame_width=300,
)
plot2 = data[selected].hvplot.hist(
    frame_height=300, frame_width=300,
)
plot3 = data[selected].melt().hvplot.box(
    frame_height=300, frame_width=300, by='variable', c='variable',
    cmap=hv.Cycle.default_cycles['default_colors'],
)
plot = plot1 + plot2 + plot3
hvplot.show(plot)
Reasons:
  • Probably link only (1):
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (0.5):
Posted by: Chris Walshaw