Closed nprihodko closed 4 months ago
After updating plotnine from 0.12.4 to 0.13.5 (this also triggers mizani update from 0.9.3 to 0.11.2) date labels stopped working.
Seems like it breaks when there are more than 3 observations (but maybe there are also other conditions).
All good:
import pandas as pd from plotnine import * plot_df = pd.DataFrame( { "x": ["2023-01-01", "2023-02-01", "2023-03-01"], "y": [1, 2, 3], } ) plot_df["x"] = pd.to_datetime(plot_df["x"]) ggplot(plot_df, aes(x="x", y="y")) + geom_point()
But if I add one more row, date axis breaks:
plot_df = pd.DataFrame( { "x": ["2023-01-01", "2023-02-01", "2023-03-01", "2023-04-01"], "y": [1, 2, 3, 4], } ) plot_df["x"] = pd.to_datetime(plot_df["x"]) ggplot(plot_df, aes(x="x", y="y")) + geom_point()
Adding scale_x_datetime() or scale_x_date() explicitly does not affect anything.
scale_x_datetime()
scale_x_date()
Fix have been released in mizani v0.11.3.
v0.11.3
After updating plotnine from 0.12.4 to 0.13.5 (this also triggers mizani update from 0.9.3 to 0.11.2) date labels stopped working.
Seems like it breaks when there are more than 3 observations (but maybe there are also other conditions).
All good:
But if I add one more row, date axis breaks:
Adding
scale_x_datetime()
orscale_x_date()
explicitly does not affect anything.