Skip to contents

A column per day and a row per hour of the day, from midnight at the top, each colored by the average of that hour, so that what happens at the same time every day shows as a horizontal band. The colors stop at the 2nd and 98th percentiles, so that a few spikes do not wash out the rest; the hover label has the exact value.

Usage

plot_daily_pattern(hourly, variable, unit = "", mode = "light")

Arguments

hourly

Data frame from get_hourly().

variable

Name of the sensor, for the title and the hover labels.

unit

Unit of the readings, "" for none.

mode

"light" or "dark", the mode of the app.

Value

A plotly object.

Examples

hourly <- expand.grid(hour = 0:23, date = as.Date("2026-10-01") + 0:13)
hourly$value <- 21 + 2 * sin((hourly$hour - 9) / 24 * 2 * pi)
plot_daily_pattern(hourly, "Temperature", "C")
url <- "http://pip1.crabdance.com:1507/api/v1/query_range" plot_daily_pattern(get_hourly(url, "temperature", days = 30), "Temperature", "C")