this is my original graph:

I didn't change the xticklabels or anything, I only did plot(x,y), the labels are automatically generated according to the x values.
However I want to change the x label to [0,24,48,72....480,504]
This is what I did
ax.plot(x1,y1)
xlabel =[]
xinterval = np.arange(0,504,24)
ax.set_xticks=(xinterval)
ax.set_xticklabels(xinterval)
And the result is:

which is obviously wrong, could anyone help?
You have a typo; it's supposed to be ax.set_xticks(xinterval), without the =.
No need for the set_xticklabels command.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With