How to set default tick params in python/matplotlib?

让人想犯罪 __ 提交于 2021-02-17 05:12:37

问题


I would like all of my plots to have ticks that point inside rather than the matplotlib default of outside. So I am looking for a way to set this using plt.rcparams()

For each plot, at the moment, I am doing:

ax.tick_params(direction='out')

But this only works for a single plot. Any idea how to set this with a default plot style at the top of the script or through plt.style.use()?


回答1:


Reading the rcParams helps:

plt.rcParams["xtick.direction"] = "out"
plt.rcParams["ytick.direction"] = "out"


来源:https://stackoverflow.com/questions/57719124/how-to-set-default-tick-params-in-python-matplotlib

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!