Issue
I have the code running properly, producing a plot but I don't see the scientific notation. Don't know why?
code:
fig,ax1 = plt.subplots()
ax1.plot(x,y,'-',color=yclr)
ax1.ticklabel_format(style='sci', axis='y')
ax2 = ax1.twinx()
ax2.plot(x,yy,'-',color=yyclr)
ax2.ticklabel_format(style='sci', axis='y')
plt.show()
Update:
Based on the accepted answer, I just included scilimits=(0,0)
and it worked. But scientific limit font size is higher than rest, which were set to 12.
Solution
Passing scilimits=(0, 0)
to ticklabel_format
should trigger it.
fig,ax1 = plt.subplots()
ax1.plot(x,y,'-',color=yclr)
ax1.ticklabel_format(style='sci', axis='y', scilimits=(0, 0))
ax2 = ax1.twinx()
ax2.plot(x,yy,'-',color=yyclr)
ax2.ticklabel_format(style='sci', axis='y', scilimits=(0, 0))
plt.show()
Answered By - Davide_sd
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.