Skip to content
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

scale_x_reverse breaks datetime formatting #1257

Open
ASmirnov-HORIS opened this issue Dec 4, 2024 · 1 comment
Open

scale_x_reverse breaks datetime formatting #1257

ASmirnov-HORIS opened this issue Dec 4, 2024 · 1 comment
Labels
bug Something isn't working
Milestone

Comments

@ASmirnov-HORIS
Copy link
Collaborator

Example:

df = pd.DataFrame({
    "x": pd.date_range(start="1-1-2000", end="1-1-2021", freq="10YE"),
    "y": [1, 3, 2],
})
ggplot(df, aes("x", "y")) + geom_point() + scale_x_reverse()

Output:

Without scale_x_reverse() formatting is correct:

@ASmirnov-HORIS ASmirnov-HORIS added the bug Something isn't working label Dec 4, 2024
@alshan alshan added this to the New milestone Dec 4, 2024
@ASmirnov-HORIS
Copy link
Collaborator Author

According to the documentation, scale_x_reverse() corresponds to a continuous scale. For the Lets-Plot API it is more natural to add a new function that knows how to reverse the date scale - something like scale_x_datetime_reversed().

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants