I have the following code to annotate a plot made with matplotlib:
for i,j in data.items():
ax.annotate(str(j), xy=(i, j))
This annotates every point on a very point dense plot. Is there anyway to only put an annotation or label on every nth point?
ax.annotate(...)inside anif counter % 50 == 0to annotate every 50th point. The counter could be added manually or by usingenumerate.