I use the following code to create a box plot and then rotate the X labels. As you can see, the X labels are not completely in the figure area. How can I fix that?
plt.figure(figsize=(8, 4))
df.boxplot()
plt.xticks(rotation=45,ha='right', rotation_mode="anchor")
plt.show()
CodePudding user response:
Try:
plt.tight_layout()
or
plt.subplots_adjust(bottom=0.15)