MathGroup Archive 2002

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

Search the Archive

RE: Plotting from a file

  • To: mathgroup at
  • Subject: [mg33122] RE: [mg33108] Plotting from a file
  • From: David.Annetts at
  • Date: Mon, 4 Mar 2002 06:03:57 -0500 (EST)
  • Sender: owner-wri-mathgroup at

Hi Sune,

In this case, a small excerpt from the file you're trying to read would be
very helpful ....

Attempting to simulate your problem below, shows no problem with under 4.01

test = Table[Random[Real, {-1, 1}], {343}];
test = Partition[test, 7] / 100000.;
Export["test01.dat", test];
testi = Import["test01.dat", "Table"];
testi == test

> 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 why.

Both the syntax and the command are incorrect ...

For the example above, 

In[31]:= Dimensions[test]

Out[31]= {49,7}

So ...
In[32]:= Dimensions[#]& /@ {test[[2]], Flatten[ColumnTake[test, {2}]]}

Out[32]= {{7},{49}}

So to plot the second column, try

sndcol = Flatten[ColumnTake[test, {2}]];
(* or Transpose[test][[2]] *)

Or the second row ....

sndrow = test[[2]];

For your other problems, I can only suggest a closer inspection of the


  Dr. David Annetts             EM Modelling Analyst
  Tel: (+612) 9490 5416         CSIRO DEM, North Ryde
  Fax: (+612) 9490 5467         David.Annetts at
                 Include "usual_disclaimers"

  • Prev by Date: Re: MathLink and lists
  • Next by Date: Re: Sums of Functions as Derivative Operators
  • Previous by thread: Re: Plotting from a file
  • Next by thread: suse 7.3 font problems