Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set default tick params in python/matplotlib?

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()?

like image 524
Ru887321 Avatar asked Sep 06 '25 10:09

Ru887321


1 Answers

Reading the rcParams helps:

plt.rcParams["xtick.direction"] = "out"
plt.rcParams["ytick.direction"] = "out"
like image 148
ImportanceOfBeingErnest Avatar answered Sep 09 '25 00:09

ImportanceOfBeingErnest