Reputation: 944
I'm coding and I want to put one label in X axis to improve my graph for one presentation.
import pandas as pd
train = pd.read_csv('titanic_train.csv')
train['Age'].hist(bins=30, alpha=0.4)
plt.show()
I want to put in X label the 'Age' text.
Upvotes: 0
Views: 37
Reputation: 653
One way to achieve that is like this:
import matplotlib.pyplot as plt
ax = train['Age'].hist(bins=30, alpha=0.4)
ax.set_xlabel("Age")
plt.show()
Upvotes: 1