Skip non-numeric columns when making a boxplot
State: closed

This PR updates the `BoxPlot` class to skip non-numeric columns when making a DataFrame boxplot. Also raises a more meaningful error message when trying to plot a datetime-like Series.  

Closes #22799.

- [x] closes #xxxx
- [x] tests added / passed
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [ ] whatsnew entry


Labels:
name: Visualization
description: plotting
name: Error Reporting
description: Incorrect or improved errors from pandas

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

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

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

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


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

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

```diff
@@            Coverage Diff             @@
##           master   #22979      +/-   ##
==========================================
- Coverage   92.21%    92.2%   -0.01%     
==========================================
  Files         161      161              
  Lines       51684    51688       +4     
==========================================
+ Hits        47658    47660       +2     
- Misses       4026     4028       +2
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `90.6% <75%> (-0.01%)` | :arrow_down: |
| #single | `42.99% <0%> (-0.01%)` | :arrow_down: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/22979?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/plotting/\_core.py](https://codecov.io/gh/pandas-dev/pandas/pull/22979/diff?src=pr&el=tree#diff-cGFuZGFzL3Bsb3R0aW5nL19jb3JlLnB5) | `83.56% <75%> (-0.03%)` | :arrow_down: |
| [pandas/io/json/json.py](https://codecov.io/gh/pandas-dev/pandas/pull/22979/diff?src=pr&el=tree#diff-cGFuZGFzL2lvL2pzb24vanNvbi5weQ==) | `92.61% <0%> (-0.48%)` | :arrow_down: |
| [pandas/util/testing.py](https://codecov.io/gh/pandas-dev/pandas/pull/22979/diff?src=pr&el=tree#diff-cGFuZGFzL3V0aWwvdGVzdGluZy5weQ==) | `87.48% <0%> (+0.09%)` | :arrow_up: |

------

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

@jrbourbeau can you merge master and address comments?
Thanks for the feedback @WillAyd 

> Is this condition specific to box plots?

Looking at `pandas/plotting/_core.py`, there are instances where datetimes aren't supported in other plots. For instance, in `hist_frame`

https://github.com/pandas-dev/pandas/blob/4b5f4d1a59a7fce09c47eb0c03ba99a6cea472c6/pandas/plotting/_core.py#L2395

and plots that inherit from `PlanePlot` (i.e. `ScatterPlot` and `HexBinPlot`)

https://github.com/pandas-dev/pandas/blob/4b5f4d1a59a7fce09c47eb0c03ba99a6cea472c6/pandas/plotting/_core.py#L800-L803

However, I think these cases are handled on an individual basis. 


I must have missed the use of the `_get_numeric_data()` method when I originally made this PR. I could replace the changes I've made in `BoxPlot` with `data = data._get_numeric_data()` to be more consistent with the existing code. 


> Might be better served as a separate issue with a more comprehensive change

That could be, I'll leave that decision to those with a better understanding of the pandas internals, like yourself 
> I could replace the changes I've made in `BoxPlot` with `data = data._get_numeric_data()` to be more consistent with the existing code.

Go ahead and do this. I'll backtrack on my comment around the error message as I think it's OK to keep in
@jrbourbeau can you merge master and address comments
Closing as stale. Ping if you'd like to continue