MathGroup Archive 2002

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

Search the Archive

Re: Plotting from a file

  • To: mathgroup at
  • Subject: [mg33113] Re: Plotting from a file
  • From: "Allan Hayes" <hay at>
  • Date: Sun, 3 Mar 2002 17:15:16 -0500 (EST)
  • References: <a5t269$65v$>
  • Sender: owner-wri-mathgroup at

The importation seems to work OK using Mathematica 4.1

    rl=ReadList["datafile.dat",Table[Word, {7}]]

  res=  Map[ToExpression[StringReplace[#, "e"->" 10^"]]&,rl,{2}]

To get the second column use
    col2 = res[[All,2]]

To plot this use
    ListPlot[col2, PlotRange ->All]

The "option2 PlotRange->All will prevent any outliers being left out.

Allan Hayes
Mathematica Training and Consulting
Leicester UK
hay at
Voice: +44 (0)116 271 4198
Fax: +44 (0)870 164 0565

"SuneF" <noluck at> wrote in message
news:a5t269$65v$1 at
> Hi
> I have this output file of floating point data from a C program.
> It is all printed in 1.435664334e-013 notation, 7 columns in total.
> When I import with:
> data=Import["datafile.dat","Table"]
> it doesn't understand the exponential notation.
> It's printing the whole file (huge file by the way) below the command and
> only a handfull of the floats seem to be understood correctly as
> If I print the numbers as 0.00000001234 then mathematica understands,
> but this is not ideal, obviously.
> Also, later when it works I need to plot the columns, something like
> Plot[data(2,*)]
> you know, plot the second column.
> The code doesn't work, mathematica doesn't take arrays like that, not sure
> I'm very confused about why mathematica have both lists, arrays and
> I don't know what to work with in this case.
> Is it possible to declare a datatype like in C++ ?
> I like to know what I'm working with, call it force of habbit ;)
> Thanks,
> Sune.

  • Prev by Date: Re: Definition needed !
  • Next by Date: Partial differential equations
  • Previous by thread: Re: Plotting from a file
  • Next by thread: RE: Plotting from a file