When plotting a DataFrame by means of DataFrame.plot()
and setting logx=True
, the major ticks of the x-axis are spaced by a factor of 100). I would like to have them spaced by a factor of 10, i.e. 10^-1, 10^0, 10^1 etc. Is there a simple way to do it?
Asked
Active
Viewed 45 times
0
-
[This](https://stackoverflow.com/questions/12608788/changing-the-tick-frequency-on-x-or-y-axis-in-matplotlib) is relevant I think. Just use `plt.xticks()` function – erncyp Jun 17 '20 at 12:43
-
See [this doc](https://matplotlib.org/3.2.1/gallery/ticks_and_spines/tick-locators.html) `ax.xaxis.set_major_locator(ticker.LogLocator(base=10, numticks=15))` – JohanC Jun 17 '20 at 14:49