pydata/pandas — pull request #7670 by sinhrks (2014-07-05 13:08:45+00:00)
Title: (WIP) BUG/CLN: Better timeseries plotting / refactoring tsplot

#6608 seems to be solved by following 4 fixes.

- [ ] ``PeriodIndex`` should support the same freqs as ``DatetimeIndex`` (Related to #7222, maybe solved by #5148)
- [ ] Better logic to find common divisor frequency (try to use ``tsplot`` as much)
- [x] When plotting with ``x_compat`` to the ``ax`` which already holds ``tsplot`` lines, ``tsplot`` lines must be redrawn on ``x_compat`` coordinates.
- [ ] Check whether ``to_timestamp(how='e')`` always revert ``PeriodIndex`` back to original ``DatetimeIndex``
- [x] If target ax already holds ``x_compat`` lines, continuous plot should be drawn on ``x_compat`` coordinates (current version already have a logic, but cannot work if ``ax`` once have ``freq`` property).

Result using current PR (modified #6608 a little to show legend).
```
s1 = pd.Series([1, 2, 3], index=[datetime.datetime(1995, 12, 31),
datetime.datetime(2000, 12, 31),
datetime.datetime(2005, 12, 31)], name='idx1')
s2 = pd.Series([1, 2, 3], index=[datetime.datetime(1997, 12, 31),
datetime.datetime(2003, 12, 31),
datetime.datetime(2008, 12, 31)], name='idx2')

ax = s1.plot(legend=True)
ax = s2.plot(legend=True)
s1.plot(ax=ax, legend=True)
```
![figure_1](https://cloud.githubusercontent.com/assets/1696302/3486598/477df0e8-0445-11e4-873b-dc619adaa92a.png)

One question is whether ``tsplot`` is categorized as public function? If so, I'll prepare separate func.