I'm trying to change the xticks in a Python graph from a long list of 280 values (all numbers) to only show every 20 or so. Here is the code I've been playing with:
p = 20
ax.xaxis.set_ticks(range(0,len(x), p), [x[i] for i in range(len(x)) if i % p == 0])
I have also tried to use the function ax.set_xticks as well, but neither gives me what I was hoping for which is tick marks only for the values 0, 20, 40, 60, etc.
Thanks,
I think you can just insert an empty label in place!
Maybe try something like this:
Which should give something like this