I would like to plot ticks markers inside of the layout. But since an update of Python, these markers are plotted outside... I try to add "ax.yaxis.set_tick_params(direction = 'in')" in my script. It works only for major values.
fig, ax = plt.subplots()
plt.loglog(testI[:],a[:],'b+',linewidth=2,label='a');
plt.loglog(testI[:],b[:],'y+',linewidth=2,label='b');
plt.xlim(6,45)
plt.ylim(10**(-7),19**(-1))
ax.yaxis.set_tick_params(direction = 'in')
ax.xaxis.set_tick_params(direction = 'in')
plt.show()
The set_tick_params
method takes a keyword argument which
that defaults to 'major'
. You want to pass 'both'
to also include the minor ticks.
Example:
from matplotlib import pyplot
(figure, axes) = pyplot.subplots()
axes.loglog([], [])
axes.set_xlim(1,100)
axes.set_ylim(1,100)
axes.xaxis.set_tick_params(direction='in', which='both')
axes.yaxis.set_tick_params(direction='in', which='both')
pyplot.show()
You could also use axes.tick_params
in that example to configure both axes in one call.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With