Re: Plot a number line

*To*: mathgroup at smc.vnet.net*Subject*: [mg79733] Re: [mg79687] Plot a number line*From*: Bob Hanlon <hanlonr at cox.net>*Date*: Fri, 3 Aug 2007 06:22:59 -0400 (EDT)*Reply-to*: hanlonr at cox.net

numberLine[xmin_, xmax_, step_: 1] := Module[ {min = Floor[xmin], max = Ceiling[xmax]}, Graphics[{Arrowheads[{-0.03, 0.03}], Arrow[{{min - 2, 0}, {max + 2, 0}}], {Line[{{#, -0.2}, {#, 0.2}}], Text[#, {#, -0.3}, {0, 1}]} & /@ Range[min, max, step]}, ImageSize -> 500]]; numberLine[-10, 10] numberLine[-10, 10, 2] Bob Hanlon ---- Diana <diana.mecum at gmail.com> wrote: > Math folks, > > I am trying to plot just an x axis number line with varying end > points. > > For example, I would like a number line with starting and ending > arrows pointing to negative and positive infinity, with the numbers > -10, -9, ..., 8, 9, 10 printed on the line. I would like just the tick > marks at integer markings. This is meant to be a template for students > to graph the solution set to an inequality on it. > > Can someone help? > > Thanks, > > Diana M. > >