Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

seaborn rotate xlabels

plt.figure(figsize=(10,5))
chart = sns.countplot(
    data=data[data['Year'] == 1980],
    x='Sport',
    palette='Set1'
)
chart.set_xticklabels(chart.get_xticklabels(), rotation=45)
Comment

change xlabel rotate in seaborn

import pandas
import matplotlib.pylab as plt
import seaborn as sns
import numpy as np
plt.rcParams["figure.figsize"] = [7.50, 3.50]
plt.rcParams["figure.autolayout"] = True
df = pandas.DataFrame({"X-Axis": [np.random.randint(10) for i in range(10)], "YAxis": [i for i in range(10)]})
bar_plot = sns.barplot(x='X-Axis', y='Y-Axis', data=df)
plt.xticks(rotation=45)
plt.show()
Comment

PREVIOUS NEXT
Code Example
Python :: conda python 3.8 
Python :: make a zero list python 
Python :: pyspark distinct select 
Python :: connect postgresql with python sqlalchemy 
Python :: count none in list python 
Python :: python confidence interval 
Python :: sklearn random forest regressor 
Python :: how to install gym 
Python :: how to get latitude and longitude from address in python 
Python :: search string array python 
Python :: --disable warning pytest 
Python :: delete element of a list from another list python 
Python :: pandas_datareader 
Python :: how to save query data into dataframe pscopg2 
Python :: pandas count specific value in column 
Python :: knn sklearn 
Python :: python split range equally 
Python :: create virtualenv in pythonanywhere 
Python :: python print only 2 decimals 
Python :: python average of two lists by row 
Python :: python - remove scientific notation 
Python :: pd.set_option show all rows 
Python :: python copy a 2D list 
Python :: create dataframe pyspark 
Python :: pandas plot xlabel 
Python :: add column as index pandas 
Python :: get length of csv file with python 
Python :: plotly write html 
Python :: how to apply logarithm in pandas dataframe 
Python :: ImportError: No module named user_agent 
ADD CONTENT
Topic
Content
Source link
Name
3+1 =