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 :: cv2 load image 
Python :: python get command line arguments 
Python :: send email python 
Python :: how to add two different times in python 
Python :: how to set default python version in macos 
Python :: python map input 
Python :: python os output to variable 
Python :: python image to pdf 
Python :: python get args 
Python :: click js selenium python 
Python :: how to add time with time delta in python 
Python :: run flask application in development mode stack overflow 
Python :: python - exclude rowin data frame based on value 
Python :: df count missing values 
Python :: python make temp file 
Python :: how to read input from stdin in python 
Python :: access to numbers in classification_report - sklearn 
Python :: opencv flip image 
Python :: add rows to dataframe pandas 
Python :: rotate image pyqt5 
Python :: token_obtain_pair check email 
Python :: python - subset specific columns name in a dataframe 
Python :: run every minute python 
Python :: closing text files in python 
Python :: remainder identifying python 
Python :: for idx, col_name in enumerate(X_train.columns): print("The coefficient for {} is {}".format(file_name, regression_model.coef_[0][idx])) 
Python :: flask download a file 
Python :: start jupyter notebook with python 3.7 
Python :: how to traverse a linked list in python 
Python :: print('Test set predictions: {}'.format(y_pred)) 
ADD CONTENT
Topic
Content
Source link
Name
9+6 =