Fix Scatter plot datetime and Axis
State: closed

closes #10611
closes #8113 
closes #10678
- [ ] tests added / passed
- [x] passes `git diff upstream/master | flake8 --diff`
- [ ] whatsnew entry

This is a first go at trying to fix the above problems. I have created two before and after notebooks here: https://gist.github.com/nparley/08c81672b0e3d7d85b00694a671f57ad


Labels:
name: Bug
name: Visualization
description: plotting

Comments:
@TomAugspurger @sinhrks 

can you rebase / update

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

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

```diff
@@            Coverage Diff             @@
##           master   #12949      +/-   ##
==========================================
- Coverage      91%      91%   -0.01%     
==========================================
  Files         145      145              
  Lines       49576    49605      +29     
==========================================
+ Hits        45119    45142      +23     
- Misses       4457     4463       +6
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `88.77% <73.07%> (-0.01%)` | :arrow_down: |
| #single | `40.56% <15.38%> (-0.02%)` | :arrow_down: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/12949?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/core/internals.py](https://codecov.io/gh/pandas-dev/pandas/pull/12949?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvaW50ZXJuYWxzLnB5) | `93.55% <100%> (ø)` | :arrow_up: |
| [pandas/core/generic.py](https://codecov.io/gh/pandas-dev/pandas/pull/12949?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZ2VuZXJpYy5weQ==) | `96.26% <100%> (ø)` | :arrow_up: |
| [pandas/tools/plotting.py](https://codecov.io/gh/pandas-dev/pandas/pull/12949?src=pr&el=tree#diff-cGFuZGFzL3Rvb2xzL3Bsb3R0aW5nLnB5) | `71.72% <66.66%> (-0.04%)` | :arrow_down: |
| [pandas/core/categorical.py](https://codecov.io/gh/pandas-dev/pandas/pull/12949?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvY2F0ZWdvcmljYWwucHk=) | `95.85% <0%> (ø)` | :arrow_up: |
| [pandas/core/base.py](https://codecov.io/gh/pandas-dev/pandas/pull/12949?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvYmFzZS5weQ==) | `95.51% <0%> (ø)` | :arrow_up: |
| [pandas/core/series.py](https://codecov.io/gh/pandas-dev/pandas/pull/12949?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvc2VyaWVzLnB5) | `94.89% <0%> (ø)` | :arrow_up: |
| [pandas/core/algorithms.py](https://codecov.io/gh/pandas-dev/pandas/pull/12949?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvYWxnb3JpdGhtcy5weQ==) | `94.57% <0%> (+0.04%)` | :arrow_up: |

------

[Continue to review full report at Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/12949?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/12949?src=pr&el=footer). Last update [56c2019...cbf3c73](https://codecov.io/gh/pandas-dev/pandas/pull/12949?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
@TomAugspurger @sinhrks What's the status of this?

@nparley can u update to fix above points and add tests?

Yes sorry I have a go at bringing this up to date

@sinhrks I have moved the login into the `PlanePlot` class. What stops this working for hexbin is that I have only overridded `_compute_plot_data` in `ScatterPlot` and not in `PlanePlot`. This is because hexbin seems to overflow if you just send it a date. To get hexbin working with dates would need the dates to be converted to numbers and then the axis formatted. 

This is actually passing I think there was a bit of a travis problem with the latest run (https://travis-ci.org/nparley/pandas/builds/152366202)

can you rebase / update?

@jreback this seems to be failing the lint but not in a file related to this PR https://travis-ci.org/nparley/pandas/jobs/158939635 that I can see?

Maybe https://github.com/pydata/pandas/pull/14198 will fix the lint error.

flake is too strict here - maybe the version changed or something 

it's not comparing case

Line 685 and 690 are both key '2000q4' it's line 681 which is the different case '2000Q4'.

@nparley hmm, you are right. but it doesn't fail flaking. can you get it to fail on travis (and then fix)?

prob need to specify that option in setup.cfg to make it active

Taking out the duplicate line as I did in that #14198 seems to pass locally and on travis. I installed a clean flake8 about 2 hours a go. This was linting locally on my PC while doing the #14198.

```
linting -> pandas/tseries
pandas/tseries/tests/test_tslib.py:685:18: F999 dictionary key '2000q4' repeated with different values
pandas/tseries/tests/test_tslib.py:690:18: F999 dictionary key '2000q4' repeated with different values
linting -> pandas/tests
```

to

```
linting -> pandas/compat
linting -> pandas/sparse
linting -> pandas/tools
linting -> pandas/tseries
linting -> pandas/tests
linting -> pandas/computation
linting -> pandas/util
```

its doesn't fail on travis, so not sure what the difference is.

It did **not** pass on travis for me. This is the current master run on my own travis 2 hours a go: https://travis-ci.org/nparley/pandas/builds/158958462 and this is with that duplicate line removed https://travis-ci.org/nparley/pandas/builds/158959215

https://travis-ci.org/pydata/pandas/builds/158970327 here is master, just passed.

make sure you are rebased.

Rebased hopefully

status of this?
I think it's awaiting feedback to see if anything else needs to be added. I updated the PR after the first comments. I.e. I don't think it's waiting for anything my end. 
@nparley can you add tests for each of the issues that this would close?
@nparley can you update and respond to comments?
@nparley can you rebase / update
Hi Guys, I think this PR is probably quite stale now. My development work is not touching pandas that much unfortunately and I don't really have that much time currently. Maybe some of the ideas can be moved into a more active PR if they are still applicable? I have tired to rebase and address the comments above to clean things up but have not tested the latest commit. 
would need a rebase
closing as stale. if you want to re-visit, pls comment and we can re-open.