def mylogfmt(x, pos):
    logx = np.log10(x)
if logx < 0:
    return '$10^{{{:.0f}}}$'.format(logx)
else:
    return '$10^{{+{:.0f}}}$'.format(logx)
formatter = ticker.FuncFormatter(mylogfmt)
ax.xaxis.set_major_formatter(formatter)
ax.yaxis.set_major_formatter(formatter)
plt.show()
Adding + sign to exponent in matplotlib axes