I want to plot two lines with matplotlib / seaborn and a logarithmic y-scale.
pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
data1=pd.Series([0.5, 1.6])
data2=pd.Series([0.5, 1.1 ])
f,ax=plt.subplots()
sns.lineplot(data1)
sns.lineplot(data2)
ax.set_yscale("log")
Ok I have two things here, that I dont want. First is having 1 and 0.6 written the scientific way isnt great and second is I actually want 0.5 to be labeled rather than 0.6. Sounds like an easy question so far with tons of solutions on stackoverflow. I tried several of them for example
import matplotlib.ticker as ticker
ax.set_yticks([0.5,1,1.5])
ax.yaxis.set_major_formatter(ticker.FormatStrFormatter("%.1f"))
I also tried the scalar formatter, the fixed locator and a lot more options.
Now to my real problem: whatever I try the 6x10-1 isn't changing. When I look for the ticks to be labeled 0.6 shouldn't be labeled actually. It seems to be some automatic label because matplotlib thinks "ok this is somehow the end of the scale, it should better be labeled anyway". While this automatism seems to stand outside of the formatting mechanics. The only way I found to change is to manually label 0.6, but I don't want to label it ...