Hi all. Here is a possible bug: when plotting a bar plot and a line plot with what I think is a linked x axis (how can I verify the x axes of both plots are linked?), the linking works when the bar plot comes first but it stops working if we plot the line plot first. (more precise description after the code) Here is the code:
# data
n = 10
dates = pd.date_range('2019-01-01', periods=n)
counts = np.random.randint(0, 13, size=n)
df = pd.DataFrame({
'date': dates,
'counts': counts,
'ecdf': counts.cumsum() / counts.sum()
})
df['ecdf'] = counts.cumsum() / counts.sum()
# plots
plot = {
'counts': hv.Bars(df, 'date', 'counts').opts(xrotation=45, width=600, height=300),
'ecdf': hv.Curve(df, 'date', 'ecdf').opts(xrotation=45, width=600, height=300)
}
# PROBLEM: switching the order of the plots by switching the comment
# below leads to different link behavior.
# Link works when counts/bar plot on top, but not when ECDF/line on top.
#
# (plot['ecdf'] + plot['counts']).cols(1)
(plot['counts'] + plot['ecdf']).cols(1)
What I mean by “the linking works in one order but not in the other” is:
- When the counts/bars are first, you can box zoom into, say, the lower right corner and see the plot change in the ecdf/line plot.
- When you flip the order of the plots, you can no longer get a box zoom in one plot to do anything to the other plot.
Is this normal, am I missing something? If not, I’d be happy to file a bug in the issue tracker.
Thanks everyone for all the work on this library and the PyViz ecosystem!
Conda env:
# some key pkgs installed widh conda (on a Macbook Pro 2019, Mojave):
#
# bokeh 1.4.0 py37_0
# holoviews 1.12.7 py_0
# numpy 1.17.4 py37hc1035e2_0
# pandas 1.0.1 py37h0573a6f_0
# python 3.7.4 h265db76_1
# jupyter 1.0.0 py37_7
# jupyter_core 4.6.1 py37_0
# jupyterlab 1.2.6 py_0 conda-forge