-1

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)
Trenton McKinney
  • 56,955
  • 33
  • 144
  • 158
  • the question needs sufficient code for a minimal reproducible example: https://stackoverflow.com/help/minimal-reproducible-example – D.L Sep 13 '22 at 16:02

1 Answers1

0

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.

James
  • 144
  • 6