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

Categories written on top of each other for multiindex bar plot with Matplotlib backend #1038

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

Comments

@MarcSkovMadsen
Copy link
Collaborator

I would expect to be able to use the a MultiIndex bar plot with the Matplotlib backend just as with the Bokeh backend. But unfortunately the categories are written on top of each other when using the Matplotlib backend.

image

import pandas as pd
import hvplot.pandas  # noqa

from bokeh.sampledata.autompg import autompg_clean as autompg

autompg.head()

autompg_long_form = autompg.groupby("yr").mean(numeric_only=True).reset_index()
autompg_long_form.head()

autompg_multi_index = autompg.query("yr<=80").groupby(['yr', 'origin']).mean(numeric_only=True)
autompg_multi_index.head()

hvplot.extension("bokeh")
autompg_multi_index.hvplot.bar(width=1000, rot=90)

hvplot.extension("matplotlib")
autompg_multi_index.hvplot.bar(width=1000, rot=90)
@MarcSkovMadsen
Copy link
Collaborator Author

I can see there is also an upstream issue in HoloViews. See holoviz/holoviews#5659.

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

1 participant