I do not understand the purpose of the inner loop. It fits Y~X using my_data and repeats this 2000 times. The result will be the same every time and all of these values are stored in m. Every individual plot will show a horizontal line.
I would think you would want to make m as long as seq(5, 24344,5), fit the model once for each j and then plot m.
Or am I misunderstanding the code?