Nurlybek Amangeldiuly
Nurlybek Amangeldiuly

Reputation: 43

Pandas plot() without axis labels

How to plot pandas dataframe without labels while using

df.plot()

Edit: I still want to keep the ticks labels

Upvotes: 0

Views: 491

Answers (1)

mozway
mozway

Reputation: 260640

df.plot() returns a matplotlib Axes object, so use this to remove the axis:

df = pd.DataFrame([[1,2],[3,4]])
ax = df.plot()
ax.xaxis.set_visible(False)
ax.yaxis.set_visible(False)

output:

enter image description here

Upvotes: 1

Related Questions