Re: [Matplotlib-users] Extended load function

2008-03-03 Thread Troels Kofoed Jacobsen
Oups, now i have attached the file

-- Forwarded message --
From: Troels Kofoed Jacobsen [EMAIL PROTECTED]
Date: Mon, Mar 3, 2008 at 3:51 PM
Subject: Extended load function
To: matplotlib-users@lists.sourceforge.net


Hi everybody

I have modified the load function (in matplotlib.mlab) to be able to load
strings e.g for use as xticks. Anyone willing to test and comment, 'cause
when i'm done i'll send it as a patch.

The usage is as follows:

from reload import load
s,A,B=reload('data.dat',usecols=(1,2),unpack=True,string=0)

here the data file is like:
# Molecule Energy1 Energy2
Fe -831-832
Pt -923-932

It can also be used without unpack, but only one array of strings can be
extracted.

-- 
Med Venlig Hilsen / Best regards

Troels Kofoed Jacobsen



-- 
Med Venlig Hilsen

Troels Kofoed Jacobsen


reload.py
Description: application/python
-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Extended load function

2008-03-03 Thread Troels Kofoed Jacobsen
Hi everybody

I have modified the load function (in matplotlib.mlab) to be able to load
strings e.g for use as xticks. Anyone willing to test and comment, 'cause
when i'm done i'll send it as a patch.

The usage is as follows:

from reload import load
s,A,B=reload('data.dat',usecols=(1,2),unpack=True,string=0)

here the data file is like:
# Molecule Energy1 Energy2
Fe -831-832
Pt -923-932

It can also be used without unpack, but only one array of strings can be
extracted.

-- 
Med Venlig Hilsen / Best regards

Troels Kofoed Jacobsen
-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Extended load function

2008-03-03 Thread John Hunter
On Mon, Mar 3, 2008 at 8:51 AM, Troels Kofoed Jacobsen
[EMAIL PROTECTED] wrote:
 Hi everybody

 I have modified the load function (in matplotlib.mlab) to be able to load
 strings e.g for use as xticks. Anyone willing to test and comment, 'cause
 when i'm done i'll send it as a patch.

 The usage is as follows:

 from reload import load
 s,A,B=reload('data.dat',usecols=(1,2),unpack=True,string=0)

You probably want to be using matplotlib.mlab.csv2rec, which already
supports heterogeneous types (including strings and datetime).  load
is meant to handle only float output, and will probably become
deprecated in favor of numpy's loadtxt.  If you want to enhance load
you should concentrate your efforts there -- numpy.io.loadtxt is just
a copy plus enhancement of matplotlib.mlab.load.

JDH

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users