I have a code for plotting different curves that appears as time increases. The number of curves that are displayed depends on the input data each time I run the program, so I could have 6, 8, 10, etc., curves (unknown). My problem is that I want to label each of the curves as "Theta n" (n is 1,2,3,4....) but I don´t know how to include that in the legend command. The graph is like the following image: