At the moment, if I set the matplotlib y ticcable marks to scientific mode, it gives me an indicator at the top of the y axis of form 1e-5
I would like to tweak this to read r'$\mathregular{10^{-5}}$' so that it prints beautifully.
Here is my sample code:
My conclusion is as follows:
1st offset printout: Text(0,0.5,u'') 2nd offset printout: Text(0,636.933,u'1e\u22125') 3rd offset printout: Text(0,636.933,u'$\\mathregular{10^{-5}}$')

You can find the code and print the number here .
There are two oddities: one of them is that I cannot overwrite 1e-5 at the top of the y axis (which is the target), and the second is that I need to run plt.tight_layout() to see this unicode value as an offset.
Can someone tell me where I am going wrong?
thanks
EDIT: In the original question, it was not clear that I would like to automatically determine the exponent how it is currently being ticklabel_format . Therefore, instead of passing the string string to the offset text, it should automatically determine this value and adjust the latex string accordingly.
source share