2) Simple Graphics: Mathematica is very useful for simple visualization of data
Reading data
ReadList["file", type] reads objects of the specified type from a file, until the end of the file is reached. The list of objects read is returned. This works well for ascii data. There is also a BinaryImport[] function for binary data.
In[21]:=
In[22]:=
Out[22]=
Making data the right shape
Partition[list, n] partitions list into non-overlapping sublists of length n.
In[23]:=
Out[23]=
In[24]:=
Out[25]=
Plotting data
ListPlot3D[array2D,options] generates a three-dimensional plot of a surface representing an array of height values. The option PlotRange->All is good to use.
In[26]:=
Out[26]=
ListDensityPlot[array2D,options] generates a density plot from a 2D array. This is useful for finite-difference results.
In[27]:=
Out[27]=
ListContourPlot[array2D,options]generates a contour plot from a 2D array. Unfortunately, you can not label the contours.
In[34]:=
Out[34]=
Out[35]=
Out[36]=
Exporting a figure
Export["file.ext", expr] exports data or graphics to a file, converting it to a format corresponding to the file extension ext. There are many graphics types
In[37]:=
Created by Mathematica (June 17, 2004)