CLN: Removing dead code in plotting and minor refactoring
State: closed

Follow up of  #26185 .
This delete dead code from the `MPLPlot._post_plot_logic_common` and move the change from #26185 into` LinePlot._post_plot_logic`.

In detail, the change are only executed when the `self.__need_to_set_index` is True
The `self._need_to_set_index` variable is only set if you call `_get_xticks`.
The only place where `_get_xticks` is called is in `LinePlot._make_plot`.
Every children of `LinePlot` that redefine `_make_plot` also redefine `_post_plot_logic`.
Therefore I move the change in `LinePlot._post_plot_logic`

Labels:
name: Visualization
description: plotting
name: Clean

Comments:
# [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/26260?src=pr&el=h1) Report
> Merging [#26260](https://codecov.io/gh/pandas-dev/pandas/pull/26260?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/80be9b5defaff892e3362a31b44ca1479c2847b6?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/26260/graphs/tree.svg?width=650&token=eZ4WkYLtcO&height=150&src=pr)](https://codecov.io/gh/pandas-dev/pandas/pull/26260?src=pr&el=tree)

```diff
@@            Coverage Diff             @@
##           master   #26260      +/-   ##
==========================================
+ Coverage   91.97%   91.98%   +<.01%     
==========================================
  Files         175      175              
  Lines       52386    52379       -7     
==========================================
- Hits        48184    48179       -5     
+ Misses       4202     4200       -2
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `90.53% <100%> (ø)` | :arrow_up: |
| #single | `40.72% <0%> (-0.15%)` | :arrow_down: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/26260?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/plotting/\_core.py](https://codecov.io/gh/pandas-dev/pandas/pull/26260/diff?src=pr&el=tree#diff-cGFuZGFzL3Bsb3R0aW5nL19jb3JlLnB5) | `83.91% <100%> (+0.27%)` | :arrow_up: |
| [pandas/io/gbq.py](https://codecov.io/gh/pandas-dev/pandas/pull/26260/diff?src=pr&el=tree#diff-cGFuZGFzL2lvL2dicS5weQ==) | `78.94% <0%> (-10.53%)` | :arrow_down: |
| [pandas/core/frame.py](https://codecov.io/gh/pandas-dev/pandas/pull/26260/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZnJhbWUucHk=) | `96.9% <0%> (-0.12%)` | :arrow_down: |
| [pandas/util/testing.py](https://codecov.io/gh/pandas-dev/pandas/pull/26260/diff?src=pr&el=tree#diff-cGFuZGFzL3V0aWwvdGVzdGluZy5weQ==) | `90.71% <0%> (+0.1%)` | :arrow_up: |

------

[Continue to review full report at Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/26260?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/26260?src=pr&el=footer). Last update [80be9b5...4ed5348](https://codecov.io/gh/pandas-dev/pandas/pull/26260?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/26260?src=pr&el=h1) Report
> Merging [#26260](https://codecov.io/gh/pandas-dev/pandas/pull/26260?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/80be9b5defaff892e3362a31b44ca1479c2847b6?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/26260/graphs/tree.svg?width=650&token=eZ4WkYLtcO&height=150&src=pr)](https://codecov.io/gh/pandas-dev/pandas/pull/26260?src=pr&el=tree)

```diff
@@            Coverage Diff             @@
##           master   #26260      +/-   ##
==========================================
+ Coverage   91.97%   91.98%   +<.01%     
==========================================
  Files         175      175              
  Lines       52386    52379       -7     
==========================================
- Hits        48184    48179       -5     
+ Misses       4202     4200       -2
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `90.53% <100%> (ø)` | :arrow_up: |
| #single | `40.72% <0%> (-0.15%)` | :arrow_down: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/26260?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/plotting/\_core.py](https://codecov.io/gh/pandas-dev/pandas/pull/26260/diff?src=pr&el=tree#diff-cGFuZGFzL3Bsb3R0aW5nL19jb3JlLnB5) | `83.91% <100%> (+0.27%)` | :arrow_up: |
| [pandas/io/gbq.py](https://codecov.io/gh/pandas-dev/pandas/pull/26260/diff?src=pr&el=tree#diff-cGFuZGFzL2lvL2dicS5weQ==) | `78.94% <0%> (-10.53%)` | :arrow_down: |
| [pandas/core/frame.py](https://codecov.io/gh/pandas-dev/pandas/pull/26260/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZnJhbWUucHk=) | `96.9% <0%> (-0.12%)` | :arrow_down: |
| [pandas/util/testing.py](https://codecov.io/gh/pandas-dev/pandas/pull/26260/diff?src=pr&el=tree#diff-cGFuZGFzL3V0aWwvdGVzdGluZy5weQ==) | `90.71% <0%> (+0.1%)` | :arrow_up: |

------

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

lgtm. @jorisvandenbossche or @TomAugspurger ?

thanks @nrebena