BUG: Correct the previous bug fixing on xlim for plotting
State: closed

- [ ] xref: #28021 #27993 
- [ ] tests added / passed
- [ ] passes `black pandas`
- [ ] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [ ] whatsnew entry


Labels:

Comments:
As I mentioned in issue #28021 , I made a big mistake in finding right bug. The problem is kind of found, which is the `ax.set_xlim` part, my previous was improper that for datetime-like plotting, then it will look differently. 

So with this hotfix, the bug for losing margins on axis mentioned in closed issues can still be fixed for `non-datetime` data, so plotting will be correct. However, for `ts_plot`, I still need to find a way to create view margin on `xaxis`. Restoring only `test_datetimelike.py` proves that ts plot can still work correctly with datetime formatter. @TomAugspurger 

sorry again for this, pls let me know if things are not clear.
So to illustrate a bit clearer:

this still works correctly since x is not `ts`:
![Screen Shot 2019-08-21 at 3 06 53 PM](https://user-images.githubusercontent.com/9269816/63434465-722e9400-c425-11e9-842a-e649d9609ac0.png)
![Screen Shot 2019-08-21 at 3 59 55 PM](https://user-images.githubusercontent.com/9269816/63438563-ca1cc900-c42c-11e9-86a7-14e92104d900.png)

while this could still have its formatter, only some margin on xaxis will need to be fixed
![Screen Shot 2019-08-21 at 3 07 17 PM](https://user-images.githubusercontent.com/9269816/63434509-85d9fa80-c425-11e9-903e-69295f49acf2.png)
![Screen Shot 2019-08-21 at 3 09 48 PM](https://user-images.githubusercontent.com/9269816/63434636-be79d400-c425-11e9-82d5-a6aeef649614.png)


Thanks @charlesdong1991. The CI failure is unrelated.

After merging this, are there any issues that need to be re-opened?

no need to reopen other PRs, the closed issue can still be fixed. The problem only occurs at `datetime-like` plotting, and with this PR, the view limit can still not be fixed for ts cases. I think I am pretty sure where the issue/bug is, I am still working on a proper solution to fix ts plots. @TomAugspurger 

And I am really sorry for this. I quickly opened this PR just to make sure users using ts plots won't be affected/having behivor change while those view limit issues can still be fixed in the new release which is probably today. 
> And I am really sorry for this. I quickly opened this PR just to make sure users using ts plots won't be affected/having behivor change while those view limit issues can still be fixed in the new release which is probably today.

No need to apologize :) The release will probably happen today.

Just to make sure I understand the outstanding issues (after merging this).

1. The xlim stuff should be fixed for non-datetime plots
2. There may still be some xlim issues for datetime plots, but it's the same as on 0.25.0?
Yes, this is very correct. I already updated the issue #28021 description and name to align with the problem. @TomAugspurger 
Great, thanks!

One last question: https://github.com/pandas-dev/pandas/pull/27993 was targeted for 1.0. So this shouldn't need to be backported to the 0.25.x branch, right?
ahh, yeah, should not be to 0.25x . The #27993 is indeed tagged for 1.0.
OK, thanks again!