Home > Software engineering >  How to have log tick marks face inward?
How to have log tick marks face inward?

Time:06-23

I'm trying to get these tickmarks for the y-axis to go inward. I have these lines after the plt.plot() lines:

plt.tick_params(axis='x', direction='in')
plt.tick_params(axis="y", direction="in")
plt.yscale("log")

The ticks are inward for the x-axis but not fully so for the y-axis. The log ticks don't seem to be inward. I've tried having the plt.yscale("log") line before and after the .tick_params lines.

enter image description here

CodePudding user response:

You need to include the minor ticks in the tick_params function using the which= argument shown in the documentation.

plt.tick_params(axis="y", which="both", direction="in")
  • Related