I'm using pandas.plotting.table to generate a matplotlib table for my data. The pandas documentation states that if the rowLabels kwarg is not specified, it uses the data index. However, I want to plot my data without the index at all. I couldn't find a way to override the setting in the pyplot table either.
Add a comment
|
2 Answers
I found it easier to bypass pandas and to fallback to calling matplotlib routines to do the plotting.
import matplotlib.pyplot as plt
import pandas as pd
df = <load your data into a pandas dataframe>
fig, ax = plt.subplots(1, 1)
ax.table(cellText=df.values, colLabels=df.keys(), loc='center')
plt.show()
See the docs for ax.table
