@@ -34,6 +34,12 @@ warnings.filterwarnings(
3434 "ignore", category=DeprecationWarning, message="parsing timezone"
3535)
3636```
37+ ``` {code-cell} ipython3
38+ # For interactive plots
39+ from bokeh.plotting import figure, show, output_notebook
40+ from bokeh.models import TeX
41+ output_notebook()
42+ ```
3743
3844%TODO improve handling of datetimes (super annoying)
3945
@@ -98,15 +104,19 @@ is {glue:text}`new_issue_avg_lifetime`.
98104---
99105tags: [hide-input]
100106---
101- fig, ax = plt.subplots(figsize=(16, 12))
102- ax.hist(new_issue_lifetime.astype("m8[D]").astype(int), bins=np.arange(30))
103- ax.set_title(
107+ title = (
104108 f"Lifetime of issues created and closed in the last "
105- f"{(np.datetime64(datetime.datetime.now()) - query_date).astype('m8[D]')}",
106- fontsize=24
109+ f"{(np.datetime64(datetime.datetime.now()) - query_date).astype('m8[D]')}"
107110)
108- ax.set_xlabel("Issue lifetime (days)", fontsize=20)
109- ax.set_ylabel(r"$\frac{issues}{day}$", fontsize=20);
111+ h, bedges = np.histogram(
112+ new_issue_lifetime.astype("m8[D]").astype(int), bins=np.arange(30)
113+ )
114+
115+ p = figure(width=670, height=400, title=title, tooltips=[("value", "@top")])
116+ p.quad(top=h, bottom=0, left=bedges[:-1], right=bedges[1:])
117+ p.xaxis.axis_label = "Issue lifetime (days)"
118+ p.yaxis.axis_label = TeX(r"\frac{issues}{day}")
119+ show(p)
110120```
111121
112122% TODO: add distribution of labels
0 commit comments