Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

matplotlib tick labels position relative to axes

Tags:

matplotlib

I set matplotlib to put ticks outside the plot area but now they overlap on the corresponding labels. the tick_params method does not provide any option to set the corresponding labels position. So I guess I will have to write my own function using text() method. In the meanwhile does any one has a better suggestion?

like image 504
user1850133 Avatar asked Feb 10 '13 18:02

user1850133


1 Answers

To shift the tick labels relative to the ticks use pad. Compare

ax.tick_params(direction='out', pad=5)
plt.draw()

with

ax.tick_params(direction='out', pad=15)
plt.draw()
like image 126
tacaswell Avatar answered Oct 23 '22 22:10

tacaswell