MathGroup Archive 2011

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: ListLinePlot starting at x=0 rather than x=1

  • To: mathgroup at smc.vnet.net
  • Subject: [mg123611] Re: ListLinePlot starting at x=0 rather than x=1
  • From: DrMajorBob <btreat1 at austin.rr.com>
  • Date: Tue, 13 Dec 2011 05:40:39 -0500 (EST)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com
  • References: <201112121145.GAA12913@smc.vnet.net>
  • Reply-to: drmajorbob at yahoo.com

n = 25;
randomWalk :=
  Transpose@{Range[0, n - 1], #} &@Accumulate[RandomReal[{-1, 1}, n]]
ListLinePlot[Table[randomWalk, {3}]]

or

Clear[randomWalk]
randomWalk[n_] :=
  Transpose@{Range[0, n - 1], #} &@Accumulate[RandomReal[{-1, 1}, n]]
ListLinePlot[Table[randomWalk[25], {3}]]

or

Clear[randomWalk]
randomWalk[n_] :=
  Transpose@{Range[0, n - 1], #} &@Accumulate[RandomReal[{-1, 1}, n]]
ListLinePlot[Array[randomWalk, 3, 24]]

Bobby

On Mon, 12 Dec 2011 05:45:17 -0600, pedro silva  
<pedro_silva58 at hotmail.com> wrote:

> greetings from a newbie!
> i'm trying to plot a bunch of numbers against n {0,1,2...}, something  
> along the lines of (from the help)
> ListLinePlot[Table[Accumulate[RandomReal[{-1, 1}, 25]], {3}]]
> , but i need the lines to start at x=0, rather than 1.  i expect this to  
> be simple, but i can't find a way to do it.  any help would be  
> appreciated!
>
> cheers,
> pedro
>


-- 
DrMajorBob at yahoo.com



  • Prev by Date: Plots come out blank except for certain limits
  • Next by Date: Re: How to run ".nb" file always in dos command line
  • Previous by thread: Re: ListLinePlot starting at x=0 rather than x=1
  • Next by thread: Re: ListLinePlot starting at x=0 rather than x=1