# Overimpose several plot on increasingly small grid

I would like to produce a single plot of a function defined over discrete points in [-1,1] as I increase the number of points while shrinking the distance.

f[x_,en_]:= -x^2;
data = Table[f[x,en],{en,10,50,10},{x,-1,1,2/en}]
ListPlot[data]


This is almost what I want, I get all the different run of f plotted with nice color, but the x-axis runs from 0 to 50 instead of going from -1 and 1.

I can obtain something closer to what I want if I do

data = Table[DiscretePlot[f[x,en],{x,-1,1,2/en}],{en,10,50,10}];
Show[data, PlotRange -> All]


but in this case all plots have the same color and are hard to distinguish

• data = Table[{x,f[x,en]},{en,10,50,10},{x,-1,1,2/en}]; ListPlot[data]? – N.J.Evans Apr 18 '17 at 12:36
• Almost, but not quite. I am now getting the color of the plot based on the x-coordinate (instead of it being based on en). – Three Diag Apr 18 '17 at 12:40
• Ah no ok, got it! – Three Diag Apr 18 '17 at 12:42
• Just add a DataRange -> {-1, 1} option to your ListPlot command – Gustavo Delfino Apr 18 '17 at 12:50