when I use this code:
plt.plot(t, 10 * t)
I get the following line:
But when I use this code:
plt.plot(t, t**2)
I get 2 lines:
What am I doing wrong here, why is it plotting 2 lines instead of 1??
Your array is not in sorted order. Most values are not displayed in the string representation that you show, but the fact that it is not sorted can be seen from the last two values that are displayed. Exactly what it does contain is unclear - maybe it turns round and backtracks on itself - but if in some place it contains the largest value immediately followed by the smallest value (or values close to these) then this will result in a straight line connecting them, which will be obvious in the quadratic plot, but which in the linear case will not be distinguishable separately from the rest of the plot.
It would be worth plotting simply plt.plot(t) to see what you actually have. Also try
t = numpy.sort(t)
plt.plot(t, t**2)