轴线样式
此示例显示了轴样式的一些配置。

from mpl_toolkits.axisartist.axislines import SubplotZeroimport matplotlib.pyplot as pltimport numpy as npif 1:fig = plt.figure(1)ax = SubplotZero(fig, 111)fig.add_subplot(ax)for direction in ["xzero", "yzero"]:# adds arrows at the ends of each axisax.axis[direction].set_axisline_style("-|>")# adds X and Y-axis from the originax.axis[direction].set_visible(True)for direction in ["left", "right", "bottom", "top"]:# hides bordersax.axis[direction].set_visible(False)x = np.linspace(-0.5, 1., 100)ax.plot(x, np.sin(x*np.pi))plt.show()
