w poniższej kodu bdate i EDATE oba datetime.datetime() obiektów:Jak mogę użyć xaxis_date() z barh()?
pylab.barh(ypos, edate - bdate, left=bdate, height=TRMWidth)
ale generuje AttributeError sposób w dates.py._to_ordinalf():
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/pyplot.py", line 1926, in barh ret = ax.barh(bottom, width, height, left, **kwargs) File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/axes.py", line 4774, in barh orientation='horizontal', **kwargs) File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/axes.py", line 4624, in bar width = self.convert_xunits(width) File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/artist.py", line 147, in convert_xunits return ax.xaxis.convert_units(x) File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/axis.py", line 1312, in convert_units ret = self.converter.convert(x, self.units, self) File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/dates.py", line 1125, in convert return date2num(value) File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/dates.py", line 260, in date2num else: return np.asarray([_to_ordinalf(val) for val in d]) File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/dates.py", line 189, in _to_ordinalf base = float(dt.toordinal())
AttributeError: 'datetime.timedelta' object has no attribute 'toordinal'
I pomyślałbym, że byłoby wspaniale, gdybym po prostu pchał datetimes na xaxis i kazałbym to ustalić szczegóły; nie tak bardzo. wszelkie sugestie dotyczące tego, w jaki sposób sprawić, by daty były podatne na Xaxis?