Define Series.plot and Series.hist in class definition
State: closed

Avoid fragile circular import between core.series and `plotting._core`, `plotting._tools`, `plotting._converter`

Ends the saga of #16913, #16931.

In the status quo, the tail end of `core.series` does:

```
import pandas.plotting._core as _gfx  # noqa
Series.plot = base.AccessorProperty(_gfx.SeriesPlotMethods,
                                                              _gfx.SeriesPlotMethods)
Series.hist = _gfx.hist_series
```

This PR moves the import of `plotting._core` to the top of the module and defines `plot` and `hist` inside the `class Series` block.

Initially this caused a bunch of test failures  because `plotting._core` itself imports `Series` (and `plotting._tools`, which also imports `Series`).  #16913 and #16931 removed these circular imports, but mysteriously that didn't solve the problem.

The one that I missed last time around was `pandas.plotting.__init__`, which imports `pandas.plotting._converter`, which imports `Series`.  Changing that to `ABSeries` in addition to the earlier ones finally fixes the problem.

 - [ ] closes #xxxx
 - [ ] tests added / passed
 - [x] passes ``git diff upstream/master -u -- "*.py" | flake8 --diff``
 - [ ] whatsnew entry


Labels:
name: Refactor
description: Internal refactoring of code

Comments:
# [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/17199?src=pr&el=h1) Report
> Merging [#17199](https://codecov.io/gh/pandas-dev/pandas/pull/17199?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/3c833db29b6f5977c78d1ade791a09a5b29cedb8?src=pr&el=desc) will **decrease** coverage by `0.02%`.
> The diff coverage is `86.66%`.

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

```diff
@@            Coverage Diff             @@
##           master   #17199      +/-   ##
==========================================
- Coverage   91.01%   90.99%   -0.03%     
==========================================
  Files         162      162              
  Lines       49502    49504       +2     
==========================================
- Hits        45053    45044       -9     
- Misses       4449     4460      +11
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `88.77% <86.66%> (-0.01%)` | :arrow_down: |
| #single | `40.26% <60%> (-0.07%)` | :arrow_down: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/17199?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/plotting/\_converter.py](https://codecov.io/gh/pandas-dev/pandas/pull/17199?src=pr&el=tree#diff-cGFuZGFzL3Bsb3R0aW5nL19jb252ZXJ0ZXIucHk=) | `63.23% <100%> (ø)` | :arrow_up: |
| [pandas/plotting/\_tools.py](https://codecov.io/gh/pandas-dev/pandas/pull/17199?src=pr&el=tree#diff-cGFuZGFzL3Bsb3R0aW5nL190b29scy5weQ==) | `79% <100%> (ø)` | :arrow_up: |
| [pandas/core/series.py](https://codecov.io/gh/pandas-dev/pandas/pull/17199?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvc2VyaWVzLnB5) | `95.04% <100%> (ø)` | :arrow_up: |
| [pandas/plotting/\_core.py](https://codecov.io/gh/pandas-dev/pandas/pull/17199?src=pr&el=tree#diff-cGFuZGFzL3Bsb3R0aW5nL19jb3JlLnB5) | `82.68% <60%> (-0.13%)` | :arrow_down: |
| [pandas/io/gbq.py](https://codecov.io/gh/pandas-dev/pandas/pull/17199?src=pr&el=tree#diff-cGFuZGFzL2lvL2dicS5weQ==) | `25% <0%> (-58.34%)` | :arrow_down: |
| [pandas/core/frame.py](https://codecov.io/gh/pandas-dev/pandas/pull/17199?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZnJhbWUucHk=) | `97.71% <0%> (-0.1%)` | :arrow_down: |

------

[Continue to review full report at Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/17199?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/17199?src=pr&el=footer). Last update [3c833db...42e2b58](https://codecov.io/gh/pandas-dev/pandas/pull/17199?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).

# [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/17199?src=pr&el=h1) Report
> Merging [#17199](https://codecov.io/gh/pandas-dev/pandas/pull/17199?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/3c833db29b6f5977c78d1ade791a09a5b29cedb8?src=pr&el=desc) will **decrease** coverage by `0.02%`.
> The diff coverage is `86.66%`.

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

```diff
@@            Coverage Diff             @@
##           master   #17199      +/-   ##
==========================================
- Coverage   91.01%   90.99%   -0.03%     
==========================================
  Files         162      162              
  Lines       49502    49504       +2     
==========================================
- Hits        45053    45044       -9     
- Misses       4449     4460      +11
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `88.77% <86.66%> (-0.01%)` | :arrow_down: |
| #single | `40.26% <60%> (-0.07%)` | :arrow_down: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/17199?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/core/series.py](https://codecov.io/gh/pandas-dev/pandas/pull/17199?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvc2VyaWVzLnB5) | `95.04% <100%> (ø)` | :arrow_up: |
| [pandas/plotting/\_tools.py](https://codecov.io/gh/pandas-dev/pandas/pull/17199?src=pr&el=tree#diff-cGFuZGFzL3Bsb3R0aW5nL190b29scy5weQ==) | `79% <100%> (ø)` | :arrow_up: |
| [pandas/plotting/\_converter.py](https://codecov.io/gh/pandas-dev/pandas/pull/17199?src=pr&el=tree#diff-cGFuZGFzL3Bsb3R0aW5nL19jb252ZXJ0ZXIucHk=) | `63.23% <100%> (ø)` | :arrow_up: |
| [pandas/plotting/\_core.py](https://codecov.io/gh/pandas-dev/pandas/pull/17199?src=pr&el=tree#diff-cGFuZGFzL3Bsb3R0aW5nL19jb3JlLnB5) | `82.68% <60%> (-0.13%)` | :arrow_down: |
| [pandas/io/gbq.py](https://codecov.io/gh/pandas-dev/pandas/pull/17199?src=pr&el=tree#diff-cGFuZGFzL2lvL2dicS5weQ==) | `25% <0%> (-58.34%)` | :arrow_down: |
| [pandas/core/frame.py](https://codecov.io/gh/pandas-dev/pandas/pull/17199?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZnJhbWUucHk=) | `97.71% <0%> (-0.1%)` | :arrow_down: |

------

[Continue to review full report at Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/17199?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/17199?src=pr&el=footer). Last update [3c833db...42e2b58](https://codecov.io/gh/pandas-dev/pandas/pull/17199?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).

ok thanks