Skip to content

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

Closed

Description

@kinyatoride

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

Activity

  1. lukelbd commented on Jun 16, 2020

    @lukelbd
    Collaborator

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

  2. scottstanie commented on Mar 11, 2021

    @scottstanie
    Contributor

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions