- #1
EngWiPy
- 1,368
- 61
How can I change the y-axis ticks and labels in Python? I also want to display the grid at each shown label. When I used the following code, I change the ticks and labels, but it also keeps the default y labels. How to remove the default ticks and labels, and create new ones?
Python:
fig, ax = plt.subplots()
ax.plot(x, y)
start, end = ax.get_ylim()
ax.set_yticks(start, end, stepsize)
plt.grid(True)