What happened?
As you can see, the x tick labels on the plot show months but no year references.
Code to reproduce:
import numpy as np
import polars as pl
import altair as alt
from datetime import datetime, timedelta
start_date = datetime(2015, 9, 10)
num_days = 3695
dates = pl.date_range(
start=start_date,
end=start_date + timedelta(days=num_days - 1),
interval="1d",
eager=True,
)
price = np.ones(num_days)
df = pl.DataFrame({
"Date": dates,
"Data": price,
})
(
alt.Chart(df.select(["Date", "Data"]))
.mark_line(opacity=0.5)
.encode(x="Date", y="Data")
.properties(height=200, width=900)
)
What would you like to happen instead?
I can think of several options:
- Display years slightly below months
- Display years in between months
- Display years in place of months
Any would work for me. 3. implies losing some granularity but maybe is simpler. Generally I think the most important value to show is the lowest frequency period that changes within the plotting window, but I haven't thought this through thoroughly.
Which version of Altair are you using?
6.0.0
What happened?
As you can see, the x tick labels on the plot show months but no year references.
Code to reproduce:
What would you like to happen instead?
I can think of several options:
Any would work for me. 3. implies losing some granularity but maybe is simpler. Generally I think the most important value to show is the lowest frequency period that changes within the plotting window, but I haven't thought this through thoroughly.
Which version of Altair are you using?
6.0.0