Re: List of Interpolated functions inside plot
- To: mathgroup at smc.vnet.net
- Subject: [mg24848] Re: [mg24831] List of Interpolated functions inside plot
- From: "Tomas Garza" <tgarza at mail.internet.com.mx>
- Date: Wed, 16 Aug 2000 03:24:11 -0400 (EDT)
- Sender: owner-wri-mathgroup at wolfram.com
Krautschik, Chris G [krautschikc at intel.co.jp] wrote: > If have defined the following interpolation for arbitrary integer m: > > xyinterp[m_] := Interpolation[Table[{x, Sin[m x]}, {x, -5, 5, 0.25}]]; > > I can plot a number of the interpolated functions on one plot as follows: > > Plot[ {xyinterp[1][x], xyinterp[2][x], xyinterp[3][x]}, {x,-5,5} ]; > > Let's say I want to plot a large number of the functions of > integer m but I > like to use the Table command since typing can become quite tedious: > > Then > > Plot[ Table[xyinterp[m][x], {m, 1, 10, 3}],{x,-5,5} ] > > doesn't work because the value of x needs to be defined pior to the > execution of the Table command. I have tried various forms of > Hold but that > doesn't seem to work. > > Any help or suggestions on how to make this work would be appreciated. I suggest you invert the order of your commands. Do each Plot first, without displaying, and then Show them together: In[1]:= az = Table[ Plot[xyinterp[m][x], {x, -5, 5}, DisplayFunction -> Identity], {m, 1, 10, 3}]; In[2]:= Show[az, DisplayFunction -> $DisplayFunction]; By the way, you might try using a coloring function for each plot so as to avoid (or, at least, reduce it) the mess in the final display, e.g. In[3]:= az = Table[ Plot[xyinterp[m][x], {x, -5, 5}, PlotStyle -> Hue[m/10], DisplayFunction -> Identity], {m, 1, 10, 3}] Tomas Garza Mexico City