I might be misunderstanding some things, but I was surprised that something I thought would be easy did not work as expected.
I had already created a histogram (code below) that shows the average power usage for the time of day. (The color=:bracket separates different times of the year.) I was quite happy with this, but wanted to change the "avg" to a percentile. I had hoped that this would be easy by defining a function that computed the percentile of a SubDataFrame myself and provide that as an argument. Unfortunately, the results are not at all as expected.
plot(
df[df.day_local .>= Date(2024, 3, 1), :],
x=:time_of_day_local,
y=:current_power,
kind=:histogram,
histfunc="avg",
xbins=attr(start=Date(1, 1, 1), nbins=24),
color=:bracket,
opacity=0.5,
marker_line_width=1.5,
Layout(barmode="overlay"),
)
I might be misunderstanding some things, but I was surprised that something I thought would be easy did not work as expected.
I had already created a histogram (code below) that shows the average power usage for the time of day. (The
color=:bracketseparates different times of the year.) I was quite happy with this, but wanted to change the"avg"to a percentile. I had hoped that this would be easy by defining a function that computed the percentile of a SubDataFrame myself and provide that as an argument. Unfortunately, the results are not at all as expected.