1

I have some time series data whereby each column signifies a y value, and the density for that y, per time, are the values within that column e.g.:

dt y=100 y=200 y=300 y=400
2018-06-04 10 50 5 0
2018-06-05 10 50 0 25
2018-06-06 20 50 0 25
2018-06-07 20 50 0 25

The values in the columns are the densities for the given y, through time.

I would like to plot this so that at y=100, between dt=2018-06-06 -> 2018-06-06 the line has a color red (for the value 10), then for y=100 between dt=2018-06-06 -> 2018-06-07 the line has the color blue for the value 20, and so on.

In essence, it is a histogram through time, where the density for a given y value between the times dt is signified by the colour of the line at that point.

I can achieve it quite easily with some splitting of the data and drawing some series in either matplotlib or plotly, which works well for small datasets. When my data becomes large e.g. 500 columns and 100k timestamps, then these fall over. I would like to use datashader, but having read the documentation I am not sure how to achieve what I want.

Is there some clever trick involving categorical variables I can use to achieve what I want? Or is there some way I can transform my data to better achieve what I want.

Sigmund Fraud
  • 173
  • 1
  • 7
  • I'm not quite able to picture what plot you are hoping to get here. If you have working code for some plotting library, can you please post that and the output it gives for a small dataset? – James A. Bednar Nov 07 '21 at 18:01
  • Hey @Sigmund Fraud I know exactly what you are looking for because I am looking to do the exact same thing with market book data. Have you gotten anywhere with this by chance? – itwasthekix Jun 14 '22 at 19:17
  • That's what I was trying to do. In the end I found manually doing in with plotly just about worked for the timeframe I needed. – Sigmund Fraud Jun 28 '22 at 08:47

0 Answers0