I’m trying to create a bar plot in Matplotlib and rotate the x-axis labels. However, I don’t want the output of the plt.xticks function to be printed.
I’m using Matplotlib and Seaborn for my visualization. Here’s the relevant part of my code:
import matplotlib.pyplot as plt
import seaborn as sns
plt.figure(figsize=(10,5))
plt.title('Feature Correlation To Yes Churn')
sns.barplot(x=corr_df.sort_values('Churn_Yes').iloc[1:-1]['Churn_Yes'].index, y=corr_df.sort_values('Churn_Yes').iloc[1:-1]['Churn_Yes'].values)
plt.xticks(rotation=90)
The plt.xticks(rotation=90) function prints out the tick locations and labels. I want to know how to suppress this output.
I tried looking into the documentation and using various methods to suppress the output, but nothing has worked so far.
How can I modify my code to prevent plt.xticks(rotation=90) from printing its output?
Vinod Baste is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.