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()
Date,Open,High,Low,Close,Volume,Adj Close
2007-04-11,35.00,35.20,34.86,34.95,30476200,34.95
2007-04-10,34.80,34.99,34.75,34.88,29279000,34.88
2007-04-09,35.10,35.15,34.75,34.78,26455900,34.78
2007-04-05,35.13,35.19,34.94,35.02,26625300,35.02
2007-04-04,35.37,35.38,35.07,35.11,34697400,35.11
2007-04-03,35.43,35.60,35.17,35.32,30965900,35.32
2007-04-02,35.36,35.53,35.11,35.29,23496200,35.29
2007-03-30,35.56,35.58,35.00,35.36,34170100,35.36
2007-03-29,35.60,35.73,35.34,35.55,27471800,35.55
2007-03-28,35.70,35.73,35.30,35.55,41421500,35.55
2007-03-27,35.80,35.90,35.66,35.79,29677300,35.79
2007-03-26,35.85,36.00,35.44,36.00,29675300,36.00
2007-03-23,35.79,35.91,35.60,35.82,33463800,35.82
2007-03-22,35.44,35.84,35.40,35.81,33626200,35.81
2007-03-21,34.75,35.70,34.73,35.48,50433800,35.48
2007-03-20,34.63,34.85,34.50,34.77,28264400,34.77
2007-03-19,34.50,34.67,34.43,34.67,26529200,34.67
2007-03-16,34.60,34.84,34.25,34.36,44797300,34.36
2007-03-15,34.20,34.68,34.11,34.52,35824800,34.52
2007-03-14,34.09,34.40,33.90,34.31,40571200,34.31
2007-03-13,34.27,34.38,34.01,34.09,38898100,34.09
2007-03-12,34.28,34.63,34.01,34.44,30206600,34.44
2007-03-09,34.57,34.64,34.22,34.32,34229800,34.32
2007-03-08,34.60,34.64,34.35,34.45,29124500,34.45
2007-03-07,34.74,34.75,34.32,34.33,38987200,34.33
2007-03-06,34.73,34.84,34.52,34.72,33997500,34.72
2007-03-05,34.74,34.97,34.52,34.55,32849400,34.55
2007-03-02,34.93,35.15,34.70,34.87,45176900,34.87
2007-03-01,34.61,35.22,34.32,35.00,51383500,35.00
2007-02-28,34.80,35.08,34.65,34.91,50719300,34.91
2007-02-27,35.30,35.69,34.50,34.66,62678500,34.66
2007-02-26,35.26,35.38,35.15,35.34,28910600,35.34
2007-02-23,35.33,35.35,35.09,35.10,38152200,35.10
2007-02-22,35.82,35.88,35.31,35.40,37663800,35.40
2007-02-21,35.99,36.10,35.82,35.91,34670300,35.63
2007-02-20,35.86,36.13,35.75,36.11,23545600,35.83
2007-02-16,36.07,36.10,35.87,35.87,31049400,35.59
2007-02-15,36.36,36.47,36.06,36.14,28618800,35.86
2007-02-14,35.93,36.50,35.79,36.47,31908100,36.19
2007-02-13,35.64,35.90,35.64,35.77,22963000,35.49
2007-02-12,35.55,35.88,35.55,35.64,19010300,35.36
2007-02-09,35.71,35.84,35.48,35.53,29808800,35.25
2007-02-08,36.06,36.06,35.60,35.74,33678200,35.46
2007-02-07,36.32,36.35,36.06,36.10,21371700,35.82
2007-02-06,36.40,36.44,36.23,36.31,22730000,36.03
2007-02-05,36.27,36.48,36.20,36.37,26202100,36.09
2007-02-02,36.26,36.40,36.12,36.27,25107200,35.99
2007-02-01,36.18,36.24,35.76,36.23,37868900,35.95
2007-01-31,36.00,36.22,35.83,36.05,36164300,35.77
2007-01-30,36.20,36.34,35.76,36.03,43142100,35.75
2007-01-29,36.07,36.35,36.03,36.19,24947500,35.91
2007-01-26,36.45,36.55,36.01,36.07,25923800,35.79
2007-01-25,36.65,36.70,36.26,36.34,25830200,36.06
2007-01-24,36.70,36.75,36.52,36.64,21458500,36.35
2007-01-23,36.68,36.74,36.38,36.55,35136000,36.27
2007-01-22,37.13,37.33,36.59,36.75,41384700,36.46
2007-01-19,37.15,37.50,36.85,36.95,62906000,36.66
2007-01-18,38.01,38.17,37.26,38.00,41619200,37.70
2007-01-17,38.18,38.28,37.85,37.98,30462800,37.68
2007-01-16,38.00,38.25,37.93,38.11,31118200,37.81
2007-01-12,37.84,38.00,37.67,37.89,25944000,37.59
2007-01-11,37.50,37.96,37.42,37.92,30831700,37.62
2007-01-10,37.38,37.61,37.34,37.56,23996600,37.27
2007-01-09,37.78,37.99,37.36,37.55,24597400,37.26
2007-01-08,37.45,37.67,37.25,37.55,23713700,37.26
2007-01-05,37.57,37.76,37.31,37.56,27027200,37.27
2007-01-04,37.97,38.00,37.45,37.75,31288800,37.46
2007-01-03,37.41,38.15,37.38,37.97,43222800,37.67
2006-12-29,37.48,37.52,37.16,37.21,25271100,36.92
2006-12-28,37.76,37.76,37.45,37.48,16862500,37.19
2006-12-27,37.79,38.03,37.57,37.79,16016200,37.50
2006-12-26,37.60,37.74,37.43,37.71,11997100,37.42
2006-12-22,37.89,37.90,37.51,37.57,15578900,37.28
2006-12-21,38.05,38.06,37.63,37.77,24847000,37.48
2006-12-20,38.13,38.49,38.01,38.15,36884600,37.57
2006-12-19,37.75,38.07,37.75,38.01,31371700,37.44
2006-12-18,37.45,38.13,37.41,38.00,50056900,37.43
2006-12-15,36.28,37.51,36.21,37.36,88383400,36.80
2006-12-14,35.49,36.33,35.36,36.21,43231200,35.66
2006-12-13,35.85,35.92,35.40,35.50,45178300,34.96
2006-12-12,35.21,35.92,35.07,35.64,49751600,35.10
2006-12-11,35.24,35.52,35.05,35.22,30071800,34.69
2006-12-08,35.15,35.36,35.00,35.27,22361800,34.74
2006-12-07,35.16,35.39,35.09,35.16,25591400,34.63
2006-12-06,35.35,35.45,35.07,35.11,40309500,34.58
2006-12-05,35.41,35.50,35.13,35.27,30242900,34.74
2006-12-04,35.43,35.50,35.27,35.39,18821400,34.86
2006-12-01,35.38,35.40,34.96,35.28,23993600,34.75
2006-11-30,35.41,35.50,35.16,35.28,23653800,34.75
2006-11-29,35.25,35.44,35.19,35.35,18155700,34.82
2006-11-28,35.30,35.36,35.05,35.20,24975900,34.67
2006-11-27,35.57,35.75,35.28,35.45,24611300,34.92
2006-11-24,35.85,35.88,35.69,35.69,7260600,35.15
2006-11-22,35.80,36.09,35.72,35.99,18785000,35.45
2006-11-21,35.98,36.00,35.72,35.80,25107200,35.26
2006-11-20,36.17,36.28,35.93,35.98,20053600,35.44
2006-11-17,35.85,36.27,35.78,36.25,30558800,35.70
2006-11-16,35.87,36.13,35.87,35.96,22899700,35.42
2006-11-15,35.51,35.92,35.49,35.79,23772200,35.25
2006-11-14,35.46,35.75,35.18,35.59,28516900,35.05
2006-11-13,35.28,35.66,35.28,35.36,20829000,34.83
2006-11-10,35.30,35.31,35.12,35.17,17988200,34.64
2006-11-09,35.51,35.66,35.25,35.29,18721400,34.76
2006-11-08,35.45,35.75,35.40,35.58,17891600,35.04
2006-11-07,35.35,35.65,35.27,35.54,24410500,35.00
2006-11-06,35.02,35.41,34.90,35.27,26821200,34.74
2006-11-03,34.78,35.00,34.69,34.77,19068400,34.25
2006-11-02,34.88,34.91,34.62,34.71,23411200,34.19
2006-11-01,35.20,35.20,34.85,34.90,24251600,34.37
2006-10-31,35.28,35.35,34.92,35.11,26628000,34.58
2006-10-30,35.22,35.41,35.11,35.20,16477100,34.67
2006-10-27,35.46,35.50,35.17,35.21,29661400,34.68
2006-10-26,35.75,35.79,35.42,35.59,19986200,35.05
2006-10-25,35.55,35.65,35.35,35.61,22101800,35.07
2006-10-24,35.45,35.58,35.34,35.42,21836200,34.89
2006-10-23,35.28,35.69,35.27,35.53,26087600,34.99
2006-10-20,35.40,35.58,35.26,35.47,27306300,34.94
2006-10-19,35.40,35.49,35.14,35.28,26200600,34.75
2006-10-18,35.82,35.84,35.46,35.56,27529300,35.02
2006-10-17,35.35,35.60,35.24,35.56,24926100,35.02
2006-10-16,35.73,35.73,35.34,35.56,31779000,35.02
2006-10-13,35.93,36.11,35.47,35.98,42578100,35.44
2006-10-12,36.25,36.32,36.10,36.22,23366500,35.67
2006-10-11,36.20,36.40,36.03,36.17,19470900,35.62
2006-10-10,36.10,36.36,36.06,36.30,23452200,35.75
2006-10-09,36.14,36.24,35.86,36.16,18366300,35.61
2006-10-06,36.08,36.30,36.03,36.14,18824200,35.60
2006-10-05,36.01,36.48,35.94,36.29,25012200,35.74
2006-10-04,35.67,36.12,35.56,36.10,30877800,35.56
2006-10-03,35.51,35.88,35.46,35.71,33103000,35.17
2006-10-02,35.40,35.71,35.28,35.50,20810200,34.96
2006-09-29,35.42,35.51,35.20,35.30,20444900,34.77
2006-09-28,35.40,35.61,35.22,35.48,19482200,34.94
2006-09-27,35.33,35.65,35.17,35.34,26501700,34.81
2006-09-26,34.90,35.62,34.89,35.44,35876800,34.91
2006-09-25,34.33,34.94,34.33,34.89,22462200,34.36
2006-09-22,34.36,34.50,34.27,34.40,17535500,33.88
2006-09-21,34.90,34.90,34.25,34.44,26426400,33.92
2006-09-20,34.87,35.07,34.65,35.02,24666500,34.25
2006-09-19,34.85,34.86,34.60,34.85,18691000,34.08
2006-09-18,34.65,34.96,34.61,34.87,22906600,34.10
2006-09-15,34.90,35.00,34.72,34.85,33383400,34.08
2006-09-14,34.55,34.86,34.50,34.78,20489400,34.01
2006-09-13,34.70,34.84,34.49,34.84,26832200,34.07
2006-09-12,34.43,34.73,34.38,34.67,22489800,33.90
2006-09-11,33.85,34.43,33.76,34.43,21509600,33.67
2006-09-08,33.90,34.05,33.88,34.01,14335300,33.26
2006-09-07,33.85,34.15,33.83,34.04,29751500,33.29
2006-09-06,33.87,34.05,33.85,33.95,18653700,33.20
2006-09-05,34.08,34.13,33.92,33.97,18110300,33.22
2006-09-01,34.18,34.27,34.02,34.14,19690100,33.39
2006-08-31,34.29,34.32,34.01,34.06,18456500,33.31
2006-08-30,34.20,34.44,34.19,34.27,14384800,33.51
2006-08-29,33.90,34.24,33.90,34.19,18400500,33.43
2006-08-28,33.70,34.00,33.70,33.93,13317500,33.18
2006-08-25,33.72,33.92,33.71,33.84,11642200,33.09
2006-08-24,33.94,34.01,33.75,33.85,14552100,33.10
2006-08-23,33.75,33.87,33.60,33.79,18150500,33.04
2006-08-22,33.90,34.19,33.68,33.96,15866100,33.21
2006-08-21,34.00,34.10,33.77,33.96,12792200,33.21
2006-08-18,33.71,34.00,33.71,34.00,17108300,33.25
2006-08-17,33.70,34.00,33.65,33.92,17518400,33.17
2006-08-16,33.37,33.84,33.32,33.71,23881000,32.96
2006-08-15,33.19,33.28,33.04,33.20,20290300,32.47
2006-08-14,32.71,33.43,32.63,32.82,24949800,32.09
2006-08-11,32.62,32.78,32.42,32.50,15347100,31.78
2006-08-10,32.35,32.78,32.24,32.67,23892500,31.95
2006-08-09,32.48,32.72,32.24,32.28,18216500,31.57
2006-08-08,32.80,32.80,32.20,32.34,23746300,31.62
2006-08-07,32.68,32.83,32.51,32.69,15692700,31.97
2006-08-04,32.91,32.99,32.60,32.80,16006100,32.07
2006-08-03,32.55,32.88,32.43,32.73,19370500,32.01
2006-08-02,32.55,32.81,32.42,32.60,16642400,31.88
2006-08-01,32.65,32.80,32.48,32.56,16690400,31.84
2006-07-31,32.80,32.91,32.68,32.69,22767500,31.97
2006-07-28,32.80,33.23,32.74,33.02,21096900,32.29
2006-07-27,32.75,32.88,32.54,32.65,21630300,31.93
2006-07-26,32.74,32.77,32.48,32.68,21298800,31.96
2006-07-25,32.80,32.81,32.45,32.70,22117100,31.98
2006-07-24,32.48,32.76,32.29,32.62,22863200,31.90
2006-07-21,32.61,32.61,32.20,32.25,29394200,31.54
2006-07-20,32.85,32.94,32.48,32.48,20572500,31.76
2006-07-19,32.58,33.04,32.49,32.88,25493500,32.15
2006-07-18,32.36,32.49,32.25,32.46,26257800,31.74
2006-07-17,32.08,32.43,32.08,32.36,23565600,31.64
2006-07-14,32.29,32.37,32.06,32.11,49234200,31.40
2006-07-13,33.01,33.06,32.56,32.67,31440400,31.95
2006-07-12,33.21,33.22,33.00,33.06,21533500,32.33
2006-07-11,33.37,33.38,32.99,33.26,22385000,32.52
2006-07-10,33.30,33.46,33.10,33.45,15835100,32.71
2006-07-07,33.35,33.51,33.21,33.30,20320700,32.56
2006-07-06,33.31,33.62,33.30,33.50,20027600,32.76
2006-07-05,33.23,33.43,33.15,33.31,25643300,32.57
2006-07-03,33.10,33.37,33.09,33.33,11967000,32.59
2006-06-30,33.33,33.37,32.94,32.96,38877500,32.23
2006-06-29,32.98,33.28,32.88,33.27,28362400,32.53
2006-06-28,32.93,33.04,32.78,32.93,20323800,32.20
2006-06-27,33.05,33.27,32.88,32.88,23559700,32.15
2006-06-26,33.18,33.27,32.92,33.21,19402700,32.48
-------------------------------------------------------------------------
SF.Net email is sponsored by:
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services
for just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel