-1

From the below figure, we can see that many data points fall in a very close range. That is why I manually set the sticks, but the problem is all the xticks have equal distance between them.

Can anyone please tell me how can I have an equal distance between xticks? so that we can differentiate between those close values clearly from the figure.

enter image description here

Animesh Kumar Paul
  • 2,241
  • 4
  • 26
  • 37
  • 1
    Do you mean something like change to a [log scale](https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.xscale.html)? – azelcer Jan 20 '22 at 18:47
  • Perhaps you can clarify what you are trying to do. You place all your ticks close together, one per data point, but then you say you don’t want them close together. Are you trying to spread the data out or just the ticks? – Jody Klymak Jan 21 '22 at 07:40
  • I want there should be equal distance between all ticks. You can see that many ticks overlap on the left side. @JodyKlymak – Animesh Kumar Paul Jan 22 '22 at 21:15

1 Answers1

0

You can use one of the two options listed below:

First option to use categorical plot

sns.pointplot(data=df, x="x", y="y", ax=ax2) #categorical plot

Second option to make x axis as string in your original graph

ax.plot(x.astype('str'), y)
yakutsa
  • 642
  • 3
  • 13