Issue
I am trying to hide x axis title, but keep x axis ticks and tick labels. The only option that I have gotten to work is ax.set_xlabel('')
. Is there an option to set x axis title's visibility alone to false? Thank you.
Solution
For a single ax
returned from a seaborn plotting function we can use ax.xaxis.label.set_visible(False)
:
import seaborn as sns
df = sns.load_dataset("tips")
ax = sns.barplot(x="day", y="total_bill", data=df)
ax.xaxis.label.set_visible(False)
Answered By - Alex
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.