📜  matplotlib x 轴在顶部 - Python 代码示例

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

代码示例1
import matplotlib.pyplot as plt
import matplotlib

fig = plt.figure()
ax = fig.add_axes([0.12,0.15,0.75,0.8])
ax.set_xlabel("X")
#Set axis to top
ax.xaxis.tick_top()
#Set x axis lable to top
ax.xaxis.set_label_position('top')