📌  相关文章
📜  更改轴和轴标签颜色 matplotlib - Python 代码示例

📅  最后修改于: 2022-03-11 14:45:38.453000             🧑  作者: Mango

代码示例1
import matplotlib.pyplot as plt

fig = plt.figure()
ax = fig.add_subplot(111)

ax.plot(range(10))
ax.set_xlabel('X-axis')
ax.set_ylabel('Y-axis')

ax.spines['bottom'].set_color('red')
ax.spines['top'].set_color('red')
ax.xaxis.label.set_color('red')
ax.tick_params(axis='x', colors='red')

plt.show()