I have already looked into [this](https://stackoverflow.com/questions/28077499/matplotlib-pyplot-plot-x-axis-ticks-in-equal-range) and [this](https://stackoverflow.com/questions/12045392/how-to-assign-equal-scaling-on-the-x-axis-in-matplotlib) and tried the methods mentioned there however, I got results that were totally different from what I am trying to do.

This is my code:

```
import numpy as np

import matplotlib.pyplot as plt
import matplotlib.ticker as plticker
from collections import Counter

fig, ax = plt.subplots()

ax.set_title("Right Ear")

x = [125,250,500,750,1000,1500,2000,3000,4000,6000,8000]

ax.set_ylabel("db HL")
ax.set_xlabel("Frequency")
plt.axis([0,9000,130,-10])
ax.set_facecolor("#ffd2d2")
ax.xaxis.set_ticks(x)
ax.xaxis.set_ticklabels(["","","500","","1K","","2K","","4K","","8K"])

ax.yaxis.set_ticks([120,110,100,90,80,70,60,50,40,30,20,10,0,-10])

ax.plot()
plt.grid(color="grey")
plt.show()

```

Which gives this result:
[![Unequally spaced grid lines](https://i.stack.imgur.com/kDciT.png)](https://i.stack.imgur.com/kDciT.png)

I cannot figure out how to make the xaxis gridlines equally spaced like this:
[![Equally spaced grid lines](https://i.stack.imgur.com/kpkj9.jpg)](https://i.stack.imgur.com/kpkj9.jpg)

The methods that have been given in the above mentioned links gave me different results.