BUG: Fix the un-pickleable plot with DatetimeIndex
State: closed

- [x] closes #18439
- [x] tests added / passed
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [x] whatsnew entry


Labels:
name: Visualization
description: plotting
name: Compat
description: pandas objects compatability with Numpy or Python functions

Comments:
can u add a test as well
@jreback Where should I add test? Inside `pandas/tests/plotting/`?
sure
0.21.1 release note as well, yes ``pandas/tests/test_plotting`` is ok (or maybe in a misc section in plotting).
# [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/18486?src=pr&el=h1) Report
> Merging [#18486](https://codecov.io/gh/pandas-dev/pandas/pull/18486?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/a7646638d06f1ce98481b88f3505e2b4badf172c?src=pr&el=desc) will **decrease** coverage by `0.01%`.
> The diff coverage is `75%`.

[![Impacted file tree graph](https://codecov.io/gh/pandas-dev/pandas/pull/18486/graphs/tree.svg?height=150&width=650&token=eZ4WkYLtcO&src=pr)](https://codecov.io/gh/pandas-dev/pandas/pull/18486?src=pr&el=tree)

```diff
@@            Coverage Diff             @@
##           master   #18486      +/-   ##
==========================================
- Coverage   91.59%   91.58%   -0.02%     
==========================================
  Files         155      153       -2     
  Lines       51255    51256       +1     
==========================================
- Hits        46948    46943       -5     
- Misses       4307     4313       +6
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `89.44% <75%> (ø)` | :arrow_up: |
| #single | `40.67% <0%> (-0.11%)` | :arrow_down: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/18486?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/plotting/\_timeseries.py](https://codecov.io/gh/pandas-dev/pandas/pull/18486/diff?src=pr&el=tree#diff-cGFuZGFzL3Bsb3R0aW5nL190aW1lc2VyaWVzLnB5) | `60.82% <75%> (+0.09%)` | :arrow_up: |
| [pandas/io/gbq.py](https://codecov.io/gh/pandas-dev/pandas/pull/18486/diff?src=pr&el=tree#diff-cGFuZGFzL2lvL2dicS5weQ==) | `25% <0%> (-58.34%)` | :arrow_down: |
| [pandas/core/frame.py](https://codecov.io/gh/pandas-dev/pandas/pull/18486/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZnJhbWUucHk=) | `97.81% <0%> (-0.1%)` | :arrow_down: |
| [pandas/io/wb.py](https://codecov.io/gh/pandas-dev/pandas/pull/18486/diff?src=pr&el=tree#diff-cGFuZGFzL2lvL3diLnB5) | | |
| [pandas/io/data.py](https://codecov.io/gh/pandas-dev/pandas/pull/18486/diff?src=pr&el=tree#diff-cGFuZGFzL2lvL2RhdGEucHk=) | | |
| [pandas/util/testing.py](https://codecov.io/gh/pandas-dev/pandas/pull/18486/diff?src=pr&el=tree#diff-cGFuZGFzL3V0aWwvdGVzdGluZy5weQ==) | `82.01% <0%> (+0.19%)` | :arrow_up: |

------

[Continue to review full report at Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/18486?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/18486?src=pr&el=footer). Last update [a764663...a3d909b](https://codecov.io/gh/pandas-dev/pandas/pull/18486?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).

Thanks @jreback, fixed!
lgtm. ping on green.
CI failed because of the test. I'll check.
@jreback Seems that the pickling `instancemethod` only works in Python 3.
Now added the restriction to Python 3.
can you update
@jreback Okay! I'll re-check the pickling issue on Python 2 and update until tomorrow.
can you update
Sorry @jreback! Now updated!
lgtm
ping on green
thanks!