lets-plot
lets-plot copied to clipboard
scale_x_datetime(): error building plot for early dates
Look at the following example:
from datetime import datetime
import pandas as pd
from lets_plot import *
LetsPlot.setup_html()
df = pd.DataFrame(
{
'd': pd.to_datetime(
[
datetime(1972, 6, 9),
datetime(1972, 6, 10),
datetime(2021, 3, 5)
]
),
'x': [0, 1, 2]
}
)
ggplot(df, aes('d', 'x')) + geom_point() + scale_x_datetime()
Here we get:
If we remove the scale, it works:
If we remove the earliest date, it works again: