OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

How to suppress output of plt.xticks(rotation=90) in Matplotlib? [duplicate]

  • Thread starter Thread starter Vinod Baste
  • Start date Start date
V

Vinod Baste

Guest
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:

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?
<p>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 <strong>plt.xticks</strong> function to be printed.</p>
<p>I'm using Matplotlib and Seaborn for my visualization. Here's the relevant part of my code:</p>
<pre class="lang-py prettyprint-override"><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)
</code></pre>
<p>The <strong>plt.xticks(rotation=90)</strong> function prints out the tick locations and labels. I want to know how to suppress this output.</p>
<p>I tried looking into the documentation and using various methods to suppress the output, but nothing has worked so far.</p>
<p>How can I modify my code to prevent <strong>plt.xticks(rotation=90)</strong> from printing its output?</p>
 

Latest posts

B
Replies
0
Views
1
Blundering Ecologist
B
Top