0
from pandas import *
import datetime
DataFrame([1,1], index =  [ datetime.datetime(2012,1,1), datetime.datetime(2012,9,1) ] ).plot()

给出 xaxis 不可读的图. 我认为原因是在tools\plotting.pycondition决定autofmt)是假的。

condition = (not self._use_dynamic_x
             and df.index.is_all_dates
             and not self.subplots
             or (self.subplots and self.sharex))

第一行不应该self._use_dynamic_x()代替吗?

4

2 回答 2

2

我认为这是熊猫的一个错误,应该是self._use_dynamic_x(),请向熊猫发布问题,以解决这个问题:

import pylab as pl
from pandas import *
import datetime
df = DataFrame([1,1], index =  [ datetime.datetime(2012,1,1), datetime.datetime(2012,9,1) ] )
df.plot()
pl.xticks(rotation=90)
于 2012-07-24T05:53:10.753 回答
1

你用的是什么版本的熊猫?

我刚刚尝试过,轴看起来很好:

http://imgur.com/FpoR7

我在 pandas 0.8.1 和 matplotlib 1.1.0

于 2012-07-23T20:18:54.720 回答