diff -r 55342d3c9d25 -r 7c4855fb8e5f loading-data-from-files/quickref.tex --- a/loading-data-from-files/quickref.tex Mon Oct 11 01:25:45 2010 +0530 +++ b/loading-data-from-files/quickref.tex Mon Oct 11 11:40:04 2010 +0530 @@ -1,8 +1,12 @@ -Creating a linear array:\\ -{\ex \lstinline| x = linspace(0, 2*pi, 50)|} +\textbf{Loading data from files} + +\lstinline|loadtxt('filename')| returns the columns of file in one +sequence. -Plotting two variables:\\ -{\ex \lstinline| plot(x, sin(x))|} +\lstinline|x, y = loadtxt('filename', unpack=True)| to obtain a file +with 2 columns in separate sequences. -Plotting two lists of equal length x, y:\\ -{\ex \lstinline| plot(x, y)|} +\lstinline|loadtxt('filename', delimiter=';')|, if the file has +columns separated by ';' instead of spaces/tabs. + +