I've read here (How to prevent numbers being changed to exponential form in Python matplotlib figure) and here (Matplotlib: disable powers of ten in log plot) and tried their solutions to no avail.
How can I convert my y-axis to display normal decimal numbers instead of scientific notation? Note this is Python 3.5.2.
Here's my code:
#Imports:
import matplotlib.pyplot as plt
possible_chars = 94
max_length = 8
pw_possibilities = []
for num_chars in range(1, max_length+1):
pw_possibilities.append(possible_chars**num_chars)
x = range(1, max_length+1)
y = pw_possibilities
#plot
plt.figure()
plt.semilogy(x, y, 'o-')
plt.xlabel("num chars in password")
plt.ylabel("number of password possibilities")
plt.title("password (PW) possibilities verses # chars in PW")
plt.show()
How do you want to display
10^15
? As1000000000000000
?! The other answer applies to the default formatter, when you switch to log scale aLogFormatter
is used which has a different set of rules. You can switch back toScalarFormatter
and disable the offsetSee http://matplotlib.org/api/ticker_api.html for all of the available
Formatter
classes.(this image is generated off of the 2.x branch, but should work on all recent version of mpl)