File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -33,6 +33,7 @@ tags: []
3333# For interactive plots
3434from bokeh.plotting import figure, show, output_notebook
3535from bokeh.palettes import Category10_10 as palette
36+ from bokeh.models import Legend
3637output_notebook()
3738```
3839
@@ -121,12 +122,18 @@ for proj, data in project_prs.items():
121122tags: [remove-input]
122123---
123124p = figure(
124- width=400 ,
125+ width=600 ,
125126 height=400,
126127 title="Merged PRs per month",
127128 x_axis_type="datetime",
128129)
130+
131+ legend_items = []
129132for (label, y), color in zip(merged_prs_per_month.items(), itertools.cycle(palette)):
130- p.line(x, y, color=color, legend_label=label)
133+ l = p.line(x, y, color=color)
134+ legend_items.append((label, [l]))
135+
136+ legend = Legend(items=legend_items, orientation="horizontal")
137+ p.add_layout(legend, "below")
131138show(p)
132139```
You can’t perform that action at this time.
0 commit comments