I have the following array in Jupyter, which I am using to plot as vertical lines from the x-axis.
array([6, 10, 18, 23, 29, 33, 50])
I am using pylab and matplotlib to do this.
I have produced the following code below thus far:
mylist = array([6, 10, 18, 23, 29, 33, 50])
mylist
for i in mylist:
axvline(mylist[i])
However, I get the following error and only my last value plotted:
---------------------------------------------------------------------------
IndexError Traceback (most recent call last)
<ipython-input-106-37afa3c95407> in <module>
2 mylist
3 for i in mylist:
----> 4 axvline(mylist[i])
IndexError: index 10 is out of bounds for axis 0 with size 7
I am struggling to understand what to do to rectify the problem.
What error am I making here?
Photo showing graph being produced
I am unable to render my image in the question due to being a new user on this site.