我想更改水平标杆y轴上的字体大小(即使“问题1”、“问题2”的字体尺寸更大)。我无法从barh的文件中找到解决方案。有可能这样做吗。如果是,哪里可以找到答案?
import matplotlib.pyplot as plt
import numpy as np
x = np.array(["Question 1", "Question 2", "Question 3", "Question 4"])
y = np.array([3, 8, 1, 10])
plt.barh(x, y)
plt.tight_layout()
plt.show()

发布于 2022-01-10 10:03:00
使用plt.yticks
import matplotlib.pyplot as plt
import numpy as np
x = np.array(["Question 1", "Question 2", "Question 3", "Question 4"])
y = np.array([3, 8, 1, 10])
plt.barh(x, y)
plt.yticks(fontsize=20)
plt.tight_layout()
plt.show()

https://stackoverflow.com/questions/70650478
复制相似问题