Thanks to visit codestin.com
Credit goes to github.com

Skip to content

automatic inversion of x axis with pandas dataframe read from a csv #191

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

Closed
kinyatoride opened this issue Jun 16, 2020 · 2 comments
Closed
Labels

Comments

@kinyatoride
Copy link

kinyatoride commented Jun 16, 2020

Description

The x axis of histogram is automatically inverted when plotted with a pandas dataframe read from a csv file. It's fine when the data is not from a csv file as far as I observed.

Steps to reproduce

import numpy as np
import pandas as pd
import proplot as plot

rng = np.random.default_rng()
x = rng.standard_normal(500)
x = pd.DataFrame(x, columns=['col'])

f = 'test.csv'
x.to_csv(f)
x1 = pd.read_csv(f, index_col=0)
fig, ax = plot.subplots()
ax.hist(x1.col.values)
plot.show()

Expected behavior: [What you expected to happen]

Actual behavior: [What actually happened]
Screen Shot 2020-06-16 at 10 20 21

Equivalent steps in matplotlib

import matplotlib.pyplot as plt
fig, ax = plt.subplots()
ax.hist(x1.col.values)

Proplot version

0.6.4

@lukelbd
Copy link
Collaborator

lukelbd commented Jun 16, 2020

Thanks for the report, this was a very simple fix: 1290536

@lukelbd lukelbd added the bug label Jun 16, 2020
@scottstanie
Copy link
Contributor

scottstanie commented Mar 11, 2021

image

This seems to happen when I specify the number of bins?

But doesn't without that...

image

I can open a separate issue if it's more helpful.
I'm on version 0.6.4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants