Xaxis autoformat issue - self._use_dynamic_x should be self._use_dynamic_x() · Issue #1666 · pandas-dev/pandas (original) (raw)

The following

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

gives a plot where the xaxis is not readable. I think the reason is that in tools\plotting.py the condition (which decides to autofmt) is false.

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

Should the first line not be self._use_dynamic_x() instead?

[See http://stackoverflow.com/questions/11619144/pandas-xaxis-auto-format-issue for discussions]