I am making a log-log plot where the y-axis goes from 0.02 to 0.1. All the tick marks on my y-axes appear as: 2x10^{-2}, 3x10^{-2} ... 0.1. I would like them as 0.02, 0.03 ... 0.1. I have tried a number of things from a relevant post: Matplotlib log scale tick label number formatting. However I could not make it work. I have something like:
ax.yaxis.set_major_formatter(ticker.FuncFormatter(lambda y, _: '{:g}'.format(y))))
This apparently resolved the issue according to the earlier posts. But does not work for me.