On 2015-07-28 10:31, (by way of c.bu...@posteo.jp) wrote: > I try to use a dates on the x-aches. With pure Python3 code it works > fine. BUt when I try to use this inside wxPython application on a > FigureCanvas it doesn't work. And I don't understand the difference > here. > > This is the error > [err] > plot.plot([datetime.date(2015, 1, 7), > TypeError: descriptor 'date' requires a 'datetime.datetime' object but > received a 'int' > [/err] > > This is the fine working pure Python3 code. <snip> > import datetime <snip> > This is the piece of wxPython code that cause the error <snip> > from datetime import datetime
There is the problem. The error has nothing to do with matplotlib. In one case you did "import datetime" and imported the datetime library. In the other you did "from datetime import datetime", thus importing the datetime type from that library. If your first version is working, change the second version to use the same import. -- Brendan Barnwell "Do not follow where the path may lead. Go, instead, where there is no path, and leave a trail." --author unknown ------------------------------------------------------------------------------ _______________________________________________ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users