Re: ListPlot question

*To*: mathgroup at smc.vnet.net*Subject*: [mg125903] Re: ListPlot question*From*: Helen Read <readhpr at gmail.com>*Date*: Fri, 6 Apr 2012 05:58:26 -0400 (EDT)*Delivered-to*: l-mathgroup@mail-archive0.wolfram.com*References*: <jljq20$ct8$1@smc.vnet.net>

On 4/5/2012 5:53 AM, JK wrote: > I have a user defined function f[x]. I want to plot it discretely > using ListPlot. > Specifically, I want to do: > > ListPlot[f[x],{x,0,0.5,0.1}] > > So I want plot 5 point from the function with 5 sequence of arguments. > However, the figure has an axis value of 0 to 5 instead of 0 to 0.5. > Is there anyway to fix this? I don't see how you are getting ListPlot to work at all, if that's really what you did. ListPlot expects a list of y-values or a list of points. You could make a table of points and then use ListPlot to plot the table. But I think what you really want here is DiscretePlot. f[x_] := x^2 DiscretePlot[f[x], {x, 0, 0.5, 0.1}, Filling -> False, PlotStyle -> PointSize[Medium]] -- Helen Read University of Vermont