RE: Plotting from a file
- To: mathgroup at smc.vnet.net
- Subject: [mg33122] RE: [mg33108] Plotting from a file
- From: David.Annetts at csiro.au
- Date: Mon, 4 Mar 2002 06:03:57 -0500 (EST)
- Sender: owner-wri-mathgroup at wolfram.com
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 ... In[19]:= test = Table[Random[Real, {-1, 1}], {343}]; test = Partition[test, 7] / 100000.; Export["test01.dat", test]; testi = Import["test01.dat", "Table"]; testi == test Out[23]=True > 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]] *) ListPlot[sndcol]; Or the second row .... sndrow = test[[2]]; ListPlot[sndrow]; For your other problems, I can only suggest a closer inspection of the Bible. Regards, Dave. -------------------------------------------------------- Dr. David Annetts EM Modelling Analyst Tel: (+612) 9490 5416 CSIRO DEM, North Ryde Fax: (+612) 9490 5467 David.Annetts at csiro.au Include "usual_disclaimers" --------------------------------------------------------