-2

I'm currently using ecdfplot with complementary=True, so the numbers accumulates very quickly.

sns.ecdfplot(y="ydata", weights="value",stat="count", complementary=True, data=df)

So the x axis ranges from 0 to 1000000. But my "values" ranges from 0 - 10000. I'm combining them with scatt erplot.
How do I set it so the tickers will be like [0, 1000, 2000, 10000, 20000, 100000, max] instead of
[0, 50000, 100000, 150000, max]

Is it possible to make axis tickers with disproportionate values? like (0, 10, 20, 50, 100,... )

TLDR: how to set custom tickers on x axis?

my full code

fig, ax = plt.subplots()

sns.ecdfplot(y="ydata", weights="value",stat="count", data=df2)
sns.ecdfplot(y="ydata", weights="value",stat="count", complementary=True, data=df1)

sns.scatterplot(y="ydata", x="value", hue="dhue",  data=df, ax=ax)

ax.set_xlabel("ydata")
ax.set_ylabel("value")

plt.show()
 

Update
ax.set(xticks=[0, 1000, 2000, 10000, 20000, 1000000]) only puts all labels to the left. I'm guessing the x axis has to scale as well to the custom ticks.

1 Answers1

1

Okay, I've found the answer myself.

I just set the scale to log with custom tickers.

ax.set_xscale('log') # setting x scale log
ax.set_xticks([0, 1000, 2000, 10000, 20000, 100000],[0, "1k", "2k", "10k", "20k", "100k"]) #custom tickers with custom labels