Vito De Tullio wrote: > Hi! > I'm a newbie of matplotlib, and I'm trying to plot a set of data... but I > got blocked... > > $ cat matplotliberr.py > #!/usr/bin/env python > > # dummy data to plot > from datetime import date, timedelta > from random import randint > x = [ date.today() + timedelta(i) for i in range(10) ] > y = [ randint(0, i) for i in range(10) ] > > from matplotlib import pyplot > pyplot.fill(x, y) # no problem using pyplot.plot(x, y)
Try fill_between instead of fill. Fill does not support units (arguments that are not simple number sequences), but fill_between does; in addition, I think fill_between is what you really want here. Eric > pyplot.show() > $ ./matplotliberr.py > /usr/lib/python2.6/site-packages/pytz/tzinfo.py:5: DeprecationWarning: the > sets module is deprecated > from sets import Set > Traceback (most recent call last): > File "./matplotliberr.py", line 10, in <module> > pyplot.fill(x, y) > File "/usr/lib/python2.6/site-packages/matplotlib/pyplot.py", line 1876, > in fill > ret = gca().fill(*args, **kwargs) > File "/usr/lib/python2.6/site-packages/matplotlib/axes.py", line 5558, in > fill > for poly in self._get_patches_for_fill(*args, **kwargs): > File "/usr/lib/python2.6/site-packages/matplotlib/axes.py", line 394, in > _grab_next_args > for seg in self._plot_2_args(remaining, **kwargs): > File "/usr/lib/python2.6/site-packages/matplotlib/axes.py", line 331, in > _plot_2_args > func(x, y) > File "/usr/lib/python2.6/site-packages/matplotlib/axes.py", line 314, in > makefill > (x[:,np.newaxis],y[:,np.newaxis])), > TypeError: list indices must be integers, not tuple > $ rpm -q python-matplotlib > python-matplotlib-0.98.5.2-1.3 > ------------------------------------------------------------------------------ Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are powering Web 2.0 with engaging, cross-platform capabilities. Quickly and easily build your RIAs with Flex Builder, the Eclipse(TM)based development software that enables intelligent coding and step-through debugging. Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com _______________________________________________ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users