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

Bar chart: x-axis order incorrect for Int64Index with multiple columns #299

Closed
mc51 opened this issue Sep 1, 2019 · 0 comments · Fixed by holoviz/holoviews#3953
Closed
Assignees
Labels
type: bug Something isn't working
Milestone

Comments

@mc51
Copy link

mc51 commented Sep 1, 2019

My conda env.
There seems to be an issue with the order of the x-axis in some situations. This happens when the DataFrame index is of type Int64Index and we depict more than one value in a bar chart.

This works as expected, i.e. the order on the x-axis is 1,2,10,11:

data = pd.DataFrame([[5, 1],
                     [5, 2],
                     [6, 10],
                     [7, 11]], columns=['a', 'b']).set_index('b')
data.hvplot.bar()

However, when adding a column to the DataFrame there is an issue. The order of the x-axis will be wrong, i.e. 1,10,11,2. So it seems that the axis gets interpreted as str instead of int:

data = pd.DataFrame([[5, 1, 66],
                     [5, 2, 66],
                     [5, 10, 66],
                     [5, 11, 66]], columns=['a', 'b', 'c']).set_index('b')
data.hvplot.bar()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants