pyplot 反转 x 轴并反转 table 子图

pyplot Reverse x axis and reverse table subplot

当我在 pyplot 中反转 x 轴时,随附的 table 不会受到影响。如何反转 table 元素的显示?

ax=ep.plot(kind='bar',table=True).invert_xaxis()

我就是这样做的...

import pandas as pd
import matplotlib.pyplot as plt 

# get the data ... note the order ...
data = [4.77, 5.52, 5.93, 6.29, 6.0, 6.95, 7.7, 9.44, 10.94, 12.35, 13.45]
df = pd.DataFrame({'data':data})

# referse the dataframe
df = df[::-1]

# ... and plot ...
ax = df.plot(kind='bar',table=True, figsize=(8,4)) # bar plots are categorical
ax.xaxis.set_visible(False) # table heading and x-labels over-printing
plt.show()

产生...

如果我们再次反转它...

df = df[::-1]

我们得到...