有没有办法使用 matplotlib 使 xaxis 底部刻度线的方向指向外,但顶部的刻度线指向内?
是的!您可以使用 set_tick_params() 方法来执行此操作。这是设置直方图以按照您的描述工作的示例:
hist.xaxis.set_ticks_position('both') # Adding ticks to both top and bottom
hist.xaxis.set_tick_params(direction='in', which='top') # The bottom will maintain the default of 'out'
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)