How to plot xticks twice

Viewed 26

I have just began to write python codes lately and don't have much knowledge. So I have this code that plots a graph using matplotlib and I would like it to mark the xticks twice. But as you may already know the code only results in the second one.

Here is the part of my code where I try to mark the xticks where I want:

plt.xticks([min(AcceptableCapacityIndex),max(AcceptableCapacityIndex)],rotation=90)
plt.xticks(np.arange(int(Cycle[0]),int(Cycle[-1]),int(Cycle[-1])/20),rotation=90)
1 Answers

You can try

plt.xticks(np.arange(int(Cycle[0]),int(Cycle[-1]),int(Cycle[-1])/20),rotation=90)</code> to set the ticks and <code>plt.xlim(min(AcceptableCapacityIndex),max(AcceptableCapacityIndex))

to set the x-axis limits.

Related