From: Johan M. <joh...@gm...> - 2008-04-30 12:53:33
|
Hello I think that my problem is linked to the data struture that I'm using for the dates since my error message is : "ValueError: setting an array element with a sequence." I use list data structure, the one that you can declare through : datetime_list = []. And maybe I souldn't use this type of data structure and another one. Regards Johan Mazel * *2008/4/29 Johan Mazel <joh...@gm...>: > Ok. > I tried to do the job through the old way and it's working. > But I have the latest version (0.91.2). Is it possible that my version > wasn't successfully installed and that an older one is doing the job ? > Anyway, thanks a lot for the (fast) help. > Johan > > 2008/4/29 John Hunter <jd...@gm...>: > > > On Tue, Apr 29, 2008 at 12:10 PM, Johan Mazel <joh...@gm...> > > wrote: > > > When you wrote "import matplotlib.ticker", you meant "from > > matplotlib.dates > > > import ticker" ? > > > > No sorry, I meant "import matplotlib.ticker as ticker" > > > > > I think I have a bug or something because I get an error like > > "ValueError: > > > setting an array element with a sequence." with a lot of debug stuff > > from > > > python and MatPlotLib > > > The line concerned is the one where I do > > plot(datetime_list,data_list). > > > It's very strange because just before I use "my_datetime.strftime("%d > > %H %M > > > %S")" with my_datetime as an element of my list and it works > > perfectly. > > > > > > Possibly your matplotlib version is a bit old. With the latest > > release (0.91.2) you can pass sequences of native datetimes in. For > > older versions, you had to convert your dates to numbers first: > > > > import matplotlib.dates as mpldates > > > > d = mpldates.date2num(datetime_list) > > ax.plot_date(d, ydata) > > > > JDH > > > > |