0

I am trying to use ax.get_xaxis for a logarithmic plot but I don't have axes. Instead I want to use a similar matplotlib.pyplot function to just use it on the current plot but I can't seem to find it online. What would it be?

Example:

plt.get_xaxis().set_major_formatter(matplotlib.ticker.ScalarFormatter())
Artur Müller Romanov
  • 4,417
  • 10
  • 73
  • 132

1 Answers1

2
ax = plt.gca() # get current axis

Now you have the axis.

(you can use similar logic with plt.gcf() to get the current figure)

missurunha
  • 108
  • 6