You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been trying to reproduce something like your lovely measles example, with data aggregated to the day rather than the year. The behavior of the date axis seems really counterintuitive; is this intended?
hv.__version__ 1.12.3
import numpy as np
import pandas as pd
import datetime as dt
import holoviews as hv
hv.extension("bokeh")
# generate fake event data
N = 1000
df = pd.DataFrame({
"date":[dt.datetime(2019,1,1,0)+dt.timedelta(hours=x) for x in
np.random.uniform(0, 1000, size=N)],
"foo":np.random.choice(["foo", "bar", "foobar", "barfoo"], size=N)
})
df["date"] = df.date.dt.date
# aggregate to counts per foo per day
df = df.groupby(["date", "foo"]).size().reset_index()
df.columns = ["date", "foo", "count"]
# build a heatmap
heatmap = hv.HeatMap(df).opts(width=500, height=200, xaxis=None)
# also aggregate results across foo for a line plot
agg = hv.Dataset(heatmap).aggregate("date", np.sum)
line = hv.Curve(agg).opts(width=500, height=150)
The hv.Curve plot automagically builds a date axis:
If I compose the heatmap and the curve, the x-axes are linked but the axis labels are screwed up:
If I compose them with the order reversed, the date axis comes back but the plots become unlinked:
Seems spooky. Is this intended or am I doing something horribly wrong?
The text was updated successfully, but these errors were encountered:
I've been trying to reproduce something like your lovely measles example, with data aggregated to the day rather than the year. The behavior of the date axis seems really counterintuitive; is this intended?
hv.__version__
1.12.3The
hv.Curve
plot automagically builds a date axis:If I compose the heatmap and the curve, the x-axes are linked but the axis labels are screwed up:
If I compose them with the order reversed, the date axis comes back but the plots become unlinked:
Seems spooky. Is this intended or am I doing something horribly wrong?
The text was updated successfully, but these errors were encountered: