Time-series visualization

Recently, I frequently started to visualize time-series with various annotations and in cycle plots to better understand their seasonality. As a reference to my future self, but also for you I will write this blog post.

Therefore, please excuse if at times there is amost no text but only code.

First I will generate some dummy data and show my existing plots.

data generation

We want to only consider the labels we have and figure out if we see a valid match there. But what does this say about precision?

Between JOIN https://stackoverflow.com/questions/44106304/merging-two-pandas-dataframes-by-interval

joined = a.merge(b,on='id')
joined = joined[joined.ts.between(joined.ts1,joined.ts2)]

other options with SQLITE and SQL BETWEEN operator would exist but are more complex to integrate (for now) https://stackoverflow.com/questions/30627968/merge-pandas-dataframes-where-one-value-is-between-two-others

Basic Label Plot

Basic interactive plot

Variant 1: multiple metrics

Variant 2: single metrik for the different devices

Question 1:

How can I move the legend of the interactive plot down and also display more than a single column? I could not get it to work so far https://github.com/holoviz/holoviews/issues/3780

Basic cycleplot

How to plot the line separately?

Scatterplots of a large quantity of points - with legend

Though this is not necessarily very indicative on the dummy dta. It could still be worth it on a full (real dataset).

Now build on (3) and create something for plotting periodicities, interactivity but scalable for the full (real) dataset:

Plotting individual points does not work in matplotlib. There are simply too many observations in the daata set. Instead, we could aggregate data and then plot it again.