SourceForge logo
SourceForge logo
Menu

Re: [matplotlib-devel] mlab reorganization

From: Darren D. <dar...@co...> - 2007年12月14日 14:05:22
On Thursday 13 December 2007 11:07:57 am John Hunter wrote:
> I moved the tools in mlab that did optional imports (the rec2gtk and
> rec2excel functions and their dependencies) out of mlab into
> toolkits.gtktools and toolkits.exceltools. As Michael noted, these
> imports can be expensive for users with gtk on their system and do not
> belong in mlab. In some cases, eg logged in over a dumb terminal with
> no x11 but where gtk is present, they also trigger text warnings or
> errors from gtk, so are a nuisance. I thought it was worth cleaning
> this up for the bugfix release.
>
> If you get a minute to test before the release, that would help -- the
> excel part requires pyExcelerator, which is pure python
> http://sourceforge.net/projects/pyexcelerator
>
> import gtk
> import matplotlib.mlab as mlab
> import matplotlib.toolkits.gtktools as gtktools
> import matplotlib.toolkits.exceltools as exceltools
>
> r = mlab.csv2rec('test.csv', checkrows=0)
>
> formatd = dict(
> weight = mlab.FormatFloat(2),
> change = mlab.FormatPercent(2),
> cost = mlab.FormatThousands(2),
> )
>
>
> exceltools.rec2excel(r, 'test.xls', formatd=formatd)
> mlab.rec2csv(r, 'test.csv', formatd=formatd)
>
>
>
> scroll = gtktools.rec2gtk(r, formatd=formatd, autowin=False)
> win = gtk.Window()
> win.set_size_request(600,800)
> win.add(scroll)
> win.show_all()
> gtk.main()
I just ran this on 64-bit linux and didnt see any problems. I do have an issue 
with pygtk on my system, but I dont think it is related to mpl:
/usr/lib64/python2.5/site-packages/gtk-2.0/gtk/__init__.py:69: Warning: 
ignoring sys.argv: it must be a list of strings
 _gtk.init_check()

View entire thread

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.
Thanks for helping keep SourceForge clean.
X





Briefly describe the problem (required):
Upload screenshot of ad (required):
Select a file, or drag & drop file here.
Screenshot instructions:

Click URL instructions:
Right-click on the ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)

More information about our ad policies

Ad destination/click URL:

AltStyle によって変換されたページ (->オリジナル) /