Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

how to rotate x axis labels in subplots

ax.tick_params(labelrotation=45)
Comment

how to rotate the x label for subplot

import matplotlib.pyplot as plt
plt.rcParams["figure.figsize"] = [7.00, 3.50]
plt.rcParams["figure.autolayout"] = True
x = [1, 2, 3, 4]
ax1 = plt.subplot()
ax1.set_xticks(x)
ax1.set_yticks(x)
ax1.set_xticklabels(["one", "two", "three", "four"], rotation=45)
ax1.set_yticklabels(["one", "two", "three", "four"], rotation=45)
ax1.tick_params(axis="both", direction="in", pad=15)
plt.show()
Comment

PREVIOUS NEXT
Code Example
Python :: selenium current url 
Python :: create new thread python 
Python :: python create n*n matrix 
Python :: how to do key sensing in python 
Python :: remove column from dataframe 
Python :: calculate mape python 
Python :: extract only year from date python 
Python :: append dataframe to another dataframe 
Python :: trim text python 
Python :: get current working directory python 
Python :: from sklearn.preprocessing import standardscaler error 
Python :: python roll a die 
Python :: python image read 
Python :: python fiscal year prior 
Python :: multiple args for pandas apply 
Python :: write set to txt python 
Python :: how to accept input as list pyhton 
Python :: age calculator in python 
Python :: numpy softmax 
Python :: python is not set from command line or npm configuration node-gyp 
Python :: how to replace nan with 0 in pandas 
Python :: python read excel set index 
Python :: remove item from list while looping 
Python :: random chiece python 
Python :: python zip listas diferente tamaño 
Python :: how to make a PKCS8 RSA signature in python 
Python :: check if directory exists python 
Python :: how to view the whole dataset in jupyternotebook 
Python :: make python file executable linux 
Python :: get most repeated instance in a queryset django 
ADD CONTENT
Topic
Content
Source link
Name
5+8 =