Mohanachz
Mohanachz

Reputation: 23

How to have log tick marks face inward?

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

Upvotes: 2

Views: 386

Answers (1)

DavidG
DavidG

Reputation: 25362

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")

Upvotes: 2

Related Questions