Re: [Matplotlib-users] csv2rec column names

2009-02-03 Thread Thomas I-N

Hello Anton,

I just had the same problem and came up with the following solution:

a = csv2rec(fname) # read a csv file into a
a[a.dtype.names[5]] # access column 6 (index 5) in the file 

As a shorthand you could assign the column names to another field in the
recarray:

a.cols = a.dtype.names
a[a.cols[5]] # access column 6 (index 5) in the file 

Hope this helps, even though it may not be good coding practice. I am a
novice myself...

Best regards,

Thomas



antonv wrote:
> 
> Hi all,
> 
> I have a lot of csv files to process, all of them with the same number of
> columns. The only issue is that each file has a unique column name for the
> fourth column. 
> 
> All the csv2rec examples I found are using the r.column_name format to
> access the data in that column which is of no use for me because of the
> unique names. Is there a way to access that data using the column number?
> I bet this should be something simple but I cannot figure it out...
> 
> Thanks in advance,
> Anton
> 




-- 
View this message in context: 
http://www.nabble.com/csv2rec-column-names-tp21267055p21809832.html
Sent from the matplotlib - users mailing list archive at Nabble.com.


--
Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM)
software. With Adobe AIR, Ajax developers can use existing skills and code to
build responsive, highly engaging applications that combine the power of local
resources and data with the reach of the web. Download the Adobe AIR SDK and
Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] ticks Locator class

2009-02-03 Thread Thomas Robitaille
Hi everyone,

I am defining my own Locator class to determine where matplotlib  
should place the ticks on the x axis. I have managed do so, except  
for one problem. In order to determine the position of the ticks on  
the x-axis, I not only need the x axis range, which I can retrieve  
with self.axis.get_view_interval(), but I also need the y-axis range,  
or at least the y position of the x-axis. Is this something that can  
be done, and if so, how?

Thank you for any help!

Thomas

--
Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM)
software. With Adobe AIR, Ajax developers can use existing skills and code to
build responsive, highly engaging applications that combine the power of local
resources and data with the reach of the web. Download the Adobe AIR SDK and
Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] setting thickness of axis frame

2009-02-03 Thread Christopher Brown
Hi Michael,

MH> The Axes object has a method for turning on the frame:
MH> set_frame_on().   How do I set the thickness of the frame that
MH> appears?

I use:

plt.gca().get_frame().set_linewidth(2)

-- 
Christopher Brown, Ph.D.
Department of Speech and Hearing Science
Arizona State University

--
Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM)
software. With Adobe AIR, Ajax developers can use existing skills and code to
build responsive, highly engaging applications that combine the power of local
resources and data with the reach of the web. Download the Adobe AIR SDK and
Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] contour animation

2009-02-03 Thread Gideon Simpson
Is it possible to do animation with contour plots?  How?
-gideon


--
Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM)
software. With Adobe AIR, Ajax developers can use existing skills and code to
build responsive, highly engaging applications that combine the power of local
resources and data with the reach of the web. Download the Adobe AIR SDK and
Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] ticks Locator class

2009-02-03 Thread Eric Firing
Thomas Robitaille wrote:
> Hi everyone,
> 
> I am defining my own Locator class to determine where matplotlib  
> should place the ticks on the x axis. I have managed do so, except  
> for one problem. In order to determine the position of the ticks on  
> the x-axis, I not only need the x axis range, which I can retrieve  
> with self.axis.get_view_interval(), but I also need the y-axis range,  
> or at least the y position of the x-axis. Is this something that can  
> be done, and if so, how?

Maybe with something like self.axis.axes.get_yaxis().get_view_interval()?

Eric


--
Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM)
software. With Adobe AIR, Ajax developers can use existing skills and code to
build responsive, highly engaging applications that combine the power of local
resources and data with the reach of the web. Download the Adobe AIR SDK and
Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] setting thickness of axis frame

2009-02-03 Thread Michael Hearne
The Axes object has a method for turning on the frame: set_frame_on().  
How do I set the thickness of the frame that appears?

Thanks,

Mike Hearne

--
Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM)
software. With Adobe AIR, Ajax developers can use existing skills and code to
build responsive, highly engaging applications that combine the power of local
resources and data with the reach of the web. Download the Adobe AIR SDK and
Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] rc params strangeness/error

2009-02-03 Thread Leo Trottier
Matplotlib 0.98.5.2
Location: C:\leo\.matplotlib
Running Windows XP SP2
Obtained from pythonxy v. 2.1.10
No rc customizations ...

I've been having a devil of a time getting my rcParams to update
mid-script.  Perhaps this isn't possible, but if that's so, it's not
entirely clear.  Even if it is so, this is seemingly a defect, because in an
interactive session one expects quite different behavior (and no amount of
iPython %reset-ing seems to be able to help).

Note that manually setting the font (or what have you) in *title* works
fine.

Here is some example code:

## BEGIN #
import matplotlib
from matplotlib import rc, rcParams, rcdefaults
from matplotlib.pyplot import plot, show, figure, title

print matplotlib.__version__
print matplotlib.get_configdir()
print
print "rcParams['font.sans-serif']:", rcParams['font.sans-serif']
print 'family is:', rcParams['font.family']
print
figure(4)
title('This should be in a sans-serif font')
show()

rcParams['font.sans-serif'] = rcParams['font.monospace']
print "rcParams['font.sans-serif']:", rcParams['font.sans-serif']
print 'family is:', rcParams['font.family']
print
figure(1)
title('This should be in a monospace font')
show()

rcParams['font.sans-serif'] = rcParams['font.serif']
print "rcParams['font.sans-serif']:", rcParams['font.sans-serif']
print 'family is:', rcParams['font.family']
print
figure(2)
title('This should be in a serif font')
show()

rcdefaults()
print "rcParams['font.sans-serif']:", rcParams['font.sans-serif']
print 'family is:', rcParams['font.family']
print
figure(3)
title('This should be back to a sans-serif font')
show()
# END 
--
Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM)
software. With Adobe AIR, Ajax developers can use existing skills and code to
build responsive, highly engaging applications that combine the power of local
resources and data with the reach of the web. Download the Adobe AIR SDK and
Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users