Skip to content

Xaxis autoformat issue - self._use_dynamic_x should be self._use_dynamic_x() #1666

@joelhoro

Description

@joelhoro

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]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions