Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

multiindex not working for bar plot with Plotly backend #1036

Open
MarcSkovMadsen opened this issue Mar 11, 2023 · 0 comments
Open

multiindex not working for bar plot with Plotly backend #1036

MarcSkovMadsen opened this issue Mar 11, 2023 · 0 comments
Labels
TRIAGE type: bug Something isn't working type: upstream Anything that requires work outside hvPlot
Milestone

Comments

@MarcSkovMadsen
Copy link
Collaborator

MarcSkovMadsen commented Mar 11, 2023

I would expect to be able to use a MultiIndex with a bar plot for the Plotly backend in the same way as for the Bokeh backend. But it does not work.

image

import hvplot.pandas  # noqa

from bokeh.sampledata.autompg import autompg_clean as df

table = df.groupby('yr').mean(numeric_only=True)
table.head()

table = df.groupby(['yr', 'origin']).mean(numeric_only=True)
table.head()

hvplot.extension("bokeh")
table.hvplot.bar(stacked=False, height=500, rot=90)

hvplot.extension("plotly")
table.hvplot.bar(stacked=False, height=500, rot=90)

I've been changing for example the height because maybe the x-axis is correct but just display outside the "visible" area. But I've not been able to get it working.

HoloViews

I can see that there is also an issue in HoloViews

import holoviews as hv  # noqa

hv.extension("plotly")

from bokeh.sampledata.autompg import autompg_clean as df

table = df.groupby(['yr', 'origin']).mean(numeric_only=True)
plot = table.hvplot.bar(stacked=False, height=500, width=1000)
plot = hv.Bars(table, kdims=['yr', 'origin'], vdims="mpg").opts(stacked=False, height=500, width=1000)

import panel as pn

pn.extension()

pn.panel(plot).servable()

image

I've reported it here holoviz/holoviews#5657

Additional Context

I've been working on improving the bar docs. As a part of this I try changing the plotting backend. I would really, really like the documentation to work for all plotting backends. That is what I would expect as a user.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
TRIAGE type: bug Something isn't working type: upstream Anything that requires work outside hvPlot
Projects
None yet
Development

No branches or pull requests

2 participants