Skip to content

VIS: datetime plots x axis format: labels now rotated? #8150

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
jorisvandenbossche opened this issue Aug 30, 2014 · 9 comments · Fixed by #8301
Closed

VIS: datetime plots x axis format: labels now rotated? #8150

jorisvandenbossche opened this issue Aug 30, 2014 · 9 comments · Fixed by #8301
Labels
Milestone

Comments

@jorisvandenbossche
Copy link
Member

Is this a regression, or a delibarate decision? Compare dev docs (http://pandas-docs.github.io/pandas-docs-travis/visualization.html#basic-plotting-plot) with stable ones (http://pandas.pydata.org/pandas-docs/stable/visualization.html#basic-plotting-plot).

The xaxis labels (the date/time indications) are now rotated instead of horizontal, which I personally think is not an improvement.

@sinhrks
Copy link
Member

sinhrks commented Aug 30, 2014

Originally time-series plot had a bug not to handle rotations, #7844. Now time-series uses the same default as normal line plot (30 degrees). I think whichever default is possible as long as consistent.

@jorisvandenbossche
Copy link
Member Author

OK, so you fixed the bug that rot was not applied correctly, but you also changed the default behaviour no? Because previously nothing was rotated?

@sinhrks
Copy link
Member

sinhrks commented Aug 30, 2014

How to say...Line plot has has 30 degrees for rotation before the fix, but not applied to time-series previously. After the fix, the default is applied to time-series (as the same as rot kw).

@jorisvandenbossche
Copy link
Member Author

s = pd.Series([1,2,3])
s.plot()

With 0.14.1:
rot0141

With master:
rot015dev

@jorisvandenbossche
Copy link
Member Author

Ah, I suppose you mean that the rotation of 30 was already in the code, only it was never actually applied? (because as you can see above, there was no rotation in 0.14, and also not in the releases before)

I personally think the rotation looks a bit odd. Certainly because it is only in one of the two axes. It is also not how default matplotlib looks, and if we deviate from that we should have a good reason I think (eg like the pandas datetime formatter, which is a big improvement compared to pure matplotlib). And in practice, it is also a behavioural change compared to previous versions.

@shoyer
Copy link
Member

shoyer commented Sep 1, 2014

I think it is better to stick with a default of no rotation, like matplotlib.

The exception would be if you wanted to add some special logic to automatically add rotation only in cases where the tick labels would otherwise overlap.

@sinhrks
Copy link
Member

sinhrks commented Sep 5, 2014

I think I've misunderstood the existing behavior. Previously 30 degree rotation was applied to specific datetime related cases. I'll fix it to revert the previous behavior back (default 0 degree and 30 degrees in some cases).

@jorisvandenbossche
Copy link
Member Author

@sinhrks yes I think the rotation was used when the enhanced pandas datetime formatting was not used, but the default matplotlib formatting (which often gives overlapping labels, therefore the default rotation)

So you have time to address this? This should certainly be fixed before 0.15 (or @TomAugspurger if you have time)

@TomAugspurger
Copy link
Contributor

Yeah I can do this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants