-
Notifications
You must be signed in to change notification settings - Fork 99
Closed
Labels
Description
Description
When pandas dataframe is passed to hist, the labels are shown in x axis. Can we put them to legend labels instead?
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, 2))
x = pd.DataFrame(x, columns=['a', 'b'])
fig, ax = plot.subplots()
ax.hist(x)
plot.show()Expected behavior: [What you expected to happen]
Show actual x values, rather than showing labels in x axis.
Actual behavior: [What actually happened]

Equivalent steps in matplotlib
import numpy as np
import matplotlib.pyplot as plt
rng = np.random.default_rng()
x = rng.standard_normal((500, 2))
x = pd.DataFrame(x, columns=['a', 'b'])
fig, ax = plt.subplots()
ax.hist(x['a'], label='a')
ax.hist(x['b'], label='b')
ax.legend()
plt.show()Proplot version
0.6.4
