hvplot
hvplot copied to clipboard
Unnecessary axis linking
ALL software version info
(this library, plus any other relevant software, e.g. bokeh, python, notebook, OS, browser, etc should be added within the dropdown below.)
Software Version Info
hvplot 0.12.1
python 3.10
bokeh 3.8.0
Win11
Firefox
Description of expected behavior and the observed behavior
When combining two plots with distinct y data/dimension the y axis shall not be linked. However this behavior is observed when both plots show multiple y data each. If multiple y columns are used in just one plot everything works as expected (no y linking).
Complete, minimal, self-contained example code that reproduces the issue
import pandas as pd
import numpy as np
import hvplot.pandas
from hvplot import hvPlot
hvplot.extension('bokeh')
from bokeh.plotting import show
df = pd.DataFrame({"a": [0, 1, 2, 3], "b": [10, 11, 12, 13], "c": [100, 101, 102, 103],
"d": [10, 11, 12, 13], "e": [20, 21, 22, 23]})
p1 = df.hvplot.line(x='a', y=['b', 'c'])
#p2 = df.hvplot.line(x='a', y='e') # this works as expected
p2 = df.hvplot.line(x='a', y=['d', 'e'])
p = (p1 + p2).cols(1)
show(hvplot.render(p))
Stack traceback and/or browser JavaScript console output
Screenshots or screencasts of the bug in action
- [ ] I may be interested in making a pull request to address this
Thanks for reporting this, I agree it's a bug and it probably due to the recent-ish optimization work done to avoid calling reset_index().