2022-06-29

variable background colour for gnuplot

I'd like to colour the background of my timeseries (a few 10^5 s, so several days) plot depending on the time of day. White for the day regions, a, say, dark blue for the night, and perhaps some transition inbetween.

Continously changing colour would be nice, but a more "blocky" design is also fine. The dataset has a resolution of ten seconds (and many columns), so the plot is already a bit slow.

I'll figure out the math myself (length of day changes over the year), for the moment a sinus (or 0/1 rectangle) with frequency of 1 d is fine, but how do I plot it so the ordinate becomes a background colour instead of vertical screen coordinate?

And, of course there is a hitch, I want everything, the actual graph and background colour, in one plot command so I can still zoom. This

set multi
gamma = 2.2; color(gray) = gray**(1./gamma)
set palette model RGB functions color(gray), color(gray), color(gray)
set pm3d map; splot [0:20] sin(x); unset pm3d

plot ....

looks super nice, after you adjust the margins etc., and is about what I'm dreaming of. I'd be happy with a black box per night, too.



No comments:

Post a Comment