I'm plotting a scatter plot with a grid. The code is as follows:
x0=4554440
y0=526375
fig, ax=plt.subplots()
ax.grid(True, linewidth=0.5, linestyle='--', which='major', color='grey')
ax.grid(True, linewidth=0.5, linestyle='--', which='major', color='grey')
ax.set_xticks(range(4554440, 4554440+9550, 382))
ax.set_yticks(range(526375, 526375+9550, 382))
ax.scatter(*zip(*serv_points), s=3)
ax.set_xlim(4554440, 4554440+9550)
ax.set_ylim(526375, 526375+9550)
ax.axes.get_xaxis().set_visible(False)
ax.axes.get_yaxis().set_visible(False)
plt.show()
And this is the output:
But I want to hide the axis values. I have already searched on how to this, using:
ax.axes.get_xaxis().set_visible(False)
ax.axes.get_yaxis().set_visible(False)
Or this
ax.set_yticklabels([])
ax.set_xticklabels([])
But the output is this:
And I want to keep the grid. Does anyone know to do this?
Thanks!