Answers for "matplotlib rotate x labels subplot"

0

rotate x labels in plots, matplotlib

plt.xticks(rotation=90)
Posted by: Guest on July-23-2021
0

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()
Posted by: Guest on October-07-2021

Code answers related to "matplotlib rotate x labels subplot"

Python Answers by Framework

Browse Popular Code Answers by Language