0

I'm plotting a seaborn plot, for example:

sns.pointplot (x=[1,2,3,10], y=[2,3,4,5])

How can I make the X ticks to have spcaing that represents their values? 10 should be further apart but the spacing is equal.

ax.xaxis.set_ticks([1,2,3,10]) does not work
BigBen
  • 46,229
  • 7
  • 24
  • 40
Luis_12345
  • 55
  • 6
  • 1
    `sns.lineplot(x=[1,2,3,10], y=[2,3,4,5], marker='o')` – BigBen Jan 05 '23 at 14:37
  • Thanks! 2 follow up questions: - How can I do it for pointplot? - any way to delete ticks withput value? – Luis_12345 Jan 05 '23 at 14:43
  • `sns.pointplot` always makes categorical ticks, for numerical ticks you need `sns.lineplot`. With `ax = sns.lineplot(...)` you can use `ax.set_xticks([1,2,3,10])` to only enable some of the ticks. `sns.lineplot` also has options to only show points. – JohanC Jan 05 '23 at 15:32

0 Answers0