Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #7234 > unrolled thread

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

Started by"McHale, Paul" <Paul.McHale@excelitas.com>
First post2011-12-15 10:02 +0000
Last post2011-12-15 10:02 +0000
Articles 1 — 1 participant

Back to article view | Back to comp.soft-sys.math.mathematica

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: ListLinePlot starting at x=0 rather than x=1 "McHale, Paul" <Paul.McHale@excelitas.com> - 2011-12-15 10:02 +0000

#7234 — Re: ListLinePlot starting at x=0 rather than x=1

From"McHale, Paul" <Paul.McHale@excelitas.com>
Date2011-12-15 10:02 +0000
SubjectRe: ListLinePlot starting at x=0 rather than x=1
Message-ID<jccgji$mit$1@smc.vnet.net>
I believe there are two ways to represent data for list plot.  The first is:

{A,B,C} which are implicitly Y values and X is assumed to be {1,2,3}

If you want to force something else, it is easiest to use a list of list where each list is a coordinate pair.

Restating above, the actual list would be:

{{1,A},{2,B},{3,C}}

Back to your code and breaking it up a little more:

m = Table[Accumulate[RandomReal[{-1, 1}, 25]], {3}] (* Generate all three{A,B,C} lists (implicit x values) *)
m = Map[Table[{i - 1, #[[i]]}, {i, 1, Length[#]}] &, m]  (* Map each list onto Table[] to add explicit x value *)
ListLinePlot[m]





-----Original Message-----
From: pedro silva [mailto:pedro_silva58@hotmail.com]
Sent: Monday, December 12, 2011 6:45 AM
Subject: ListLinePlot starting at x=0 rather than x=1

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

[toc] | [standalone]


Back to top | Article view | comp.soft-sys.math.mathematica


csiph-web