0

Using a pyplot scatterplot to graph some data with exponentially-changing x-values, the range of my xticks is so vast that it causes the smaller-value xticks to be squished together. how can I adjust the spacing between the ticks so that they are equally apart, yet maintain the same values?

ads = plt.figure()
ads, axs = plt.subplots(2, sharex=True)
axs[0].scatter(x='fold_dil', y='foci', data=rep1)
axs[1].scatter(x='fold_dil', y='foci', data=rep2)
plt.show()

enter image description here

I've tried googling, but I'm new to Python and I could use as much help as I can get.

I'mahdi
  • 23,382
  • 5
  • 22
  • 30
hanoivey
  • 11
  • 2
  • 1
    `axs[0].set_xscale('log')` and `axs[1].set_xscale('log')` – tdy Dec 20 '22 at 20:57
  • 1
    see [how to plot logarithmic axes](https://stackoverflow.com/q/773814/13138364) for details – tdy Dec 20 '22 at 20:59
  • `axs[0].set_xscale('log', basex=2); axs[0].xaxis.set_major_formatter(matplotlib.ticker.ScalarFormatter())` – JohanC Dec 20 '22 at 22:05

0 Answers0