I have a set of equations and I plotted them as follows. I want to plot gridlines for each equation accordingly and assign the same color to the gridline in the same order as the set of the functions. How should I do this?
y = {x, 2 x, 3 x, 4 x};
gridlines = {1, 2, 3, 4};
Plot[Evaluate@Table[y[[i]], {i, 1, 4}], {x, 0, 4},
GridLines -> {gridlines, None}]