dayplot

A simple-to-use Python library to build calendar heatmaps with ease. It's built on top of matplotlib and leverages it to access high customization possibilities. They can even be interactive!
Examples




import matplotlib.pyplot as plt
import dayplot as dp
df = dp.load_dataset("pandas")
fig, ax = plt.subplots(figsize=(15, 6))
dp.calendar(
dates=df["dates"],
values=df["values"],
start_date="2024-01-01",
end_date="2024-12-31",
color_for_none="#bcbcbc",
edgecolor="white",
edgewidth=0.4,
cmap="OrRd",
day_kws={"color": "white"},
month_kws={"color": "white"},
ax=ax,
)
fig.set_facecolor("#2a2929")
ax.set_facecolor("#2a2929")


import matplotlib.pyplot as plt
import dayplot as dp
df = dp.load_dataset("pandas")
fig, ax = plt.subplots(figsize=(16, 4))
dp.calendar(
dates=df["dates"],
values=df["values"],
start_date="2024-01-01",
end_date="2024-12-31",
ax=ax,
**dp.styles["github"]
)
fig.set_facecolor("#0d1117")
ax.set_facecolor("#0d1117")
You can also make dayplot interactive thanks to plotjs:
import matplotlib.pyplot as plt
import dayplot as dp
from plotjs import PlotJS
df = dp.load_dataset()
fig, ax = plt.subplots(figsize=(15, 6))
dp.calendar(
dates=df["dates"],
values=df["values"],
start_date="2024-01-01",
end_date="2024-12-31",
ax=ax,
)
PlotJS(fig).add_tooltip(labels=df["values"]).save("docs/img/interactive.html")
