While a log base of 10 is common, we might need to use other bases when the data has a larger or smaller range. The base of the log scale can be adjusted by using the two keyword arguments, basex or basey, in pyplot.xscale() and pyplot.yscale() respectively. In the following example, a log2 scale is used on the y axis.
This time, we add basey=2 in our pyplot.yscale() call:
plt.yscale('log', basey=2)