Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

python + matplotlib: How to make XTick Markers symmetric over the axis?

on a normal matplotlib's plot, how can I format the tick markers of the x axis to "cut" the axis symmetrically?

Standard, it is like this:

x tick markers standard way

I want them like this:

enter image description here

Any idea?

Thanks

like image 435
otmezger Avatar asked Feb 14 '26 01:02

otmezger


1 Answers

I think you're looking for the ticks parameters.

 matplotlib.axes.tick_params(direction='inout')
like image 143
Joël Avatar answered Feb 15 '26 13:02

Joël