ENH GH11978 access pd.plotting._misc from plot accessor
State: closed

- [X] closes #11978
- [X] tests added / passed
- [X] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [X] whatsnew entry

Allows plot accessors to use plotting functions from `pd.plotting`

- Currently only allows function calls (e.g. `df.plot.scatter_matrix()` but not `df.plot(kind='scatter_matrix')` because the handling of the `kind` keyword is interpreted with plot classes whereas the plotting tools in `pd.plotting` are functions. Should the new plotting methods be hard-coded in? Or the misc tools could be refactored into classes?

- Good tests already exist in `test_misc.py`, but they're not easily parametrizable with the plot accessor case (misc functions have frame/series parameter, plot accessor functions don't). Is it okay to have mostly copy-pasted variations of those test cases in `test_frame.py` and `test_series.py` or should they be tested together some other way?

Labels:
name: Visualization
description: plotting
name: API Design

Comments:
Hello @JustinZhengBC! Thanks for submitting the PR.

 - There are no PEP8 issues in the file [`pandas/plotting/_core.py`](https://github.com/JustinZhengBC/pandas/blob/9583b6dd28f98a40a12185627ca2167a34ae4c21/pandas/plotting/_core.py) !

 - There are no PEP8 issues in the file [`pandas/tests/plotting/test_frame.py`](https://github.com/JustinZhengBC/pandas/blob/9583b6dd28f98a40a12185627ca2167a34ae4c21/pandas/tests/plotting/test_frame.py) !

 - There are no PEP8 issues in the file [`pandas/tests/plotting/test_series.py`](https://github.com/JustinZhengBC/pandas/blob/9583b6dd28f98a40a12185627ca2167a34ae4c21/pandas/tests/plotting/test_series.py) !


# [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/23811?src=pr&el=h1) Report
> Merging [#23811](https://codecov.io/gh/pandas-dev/pandas/pull/23811?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/5d134ec1a9ab118abbd16157bd161783547117e6?src=pr&el=desc) will **increase** coverage by `<.01%`.
> The diff coverage is `100%`.

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

```diff
@@            Coverage Diff             @@
##           master   #23811      +/-   ##
==========================================
+ Coverage   92.29%   92.29%   +<.01%     
==========================================
  Files         162      162              
  Lines       51841    51856      +15     
==========================================
+ Hits        47847    47862      +15     
  Misses       3994     3994
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `90.7% <100%> (ø)` | :arrow_up: |
| #single | `42.98% <53.33%> (ø)` | :arrow_up: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/23811?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/plotting/\_core.py](https://codecov.io/gh/pandas-dev/pandas/pull/23811/diff?src=pr&el=tree#diff-cGFuZGFzL3Bsb3R0aW5nL19jb3JlLnB5) | `83.76% <100%> (+0.17%)` | :arrow_up: |

------

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

@JustinZhengBC can you merge master
thanks @JustinZhengBC 
@JustinZhengBC I reverted this in #24912. And to be clear it has certainly nothing to do with the quality of the PR or so, just that after consideration decided that we would rather not expose those extra plotting methods. And sorry for the quick PR, it's just that I wanted to do this before the release which hopefully happens today. In any case, thanks for your contributions!