Pandas creates default yticklabels for logy plots. I want to replace these labels with my own labels but for some reason I can't seem to remove the default labels.
If I specify the yticks inside the plot
method, it just writes over the existing default label:
x = [1, 1.5, 2, 2.5, 3]
df = pd.DataFrame({'x': x})
ax = df.plot(logy=True, yticks=[2])
Line plot with overwritten labels:
Trying to remove the yticklabels by referencing the axes
directly doesn't help either:
ax = df.plot(logy=True)
ax.set_yticklabels([])
Line plot with default labels still there