Skip to main content
Edited title and tags
Link
mkt
  • 20.4k
  • 11
  • 81
  • 187

How can I plot presence/absence data on a time series in R or Python?

Post Reopened by Stephan Kolassa, mkt, whuber
Post Closed as "Not suitable for this site" by mdewey, whuber
edited tags
Link
Stephan Kolassa
  • 130.8k
  • 22
  • 264
  • 497
Source Link

How can I plot presence/absence data on a time series in R or Python?

I have some schedule data in the following format

groupA     10  16
groupA     10  16
groupA     12  18
groupA     12  14
groupB     16  20
groupB     16  22 
groupB     18  24
groupC     00  10 
groupC     04  12 
groupC     08  16 

I want to create a plot with three lines on the Y axis, and a range from 0 to 24 on the X axis. At a minimum I want to be able to create a gantt-like chart, with a separate line in the plot for each line above, colour coded by the first column (group identifier), but preferably, I'd like to have it so that there are only three lines in the plot, one for each group, increasing the hue of across the line to represent density - although it just occurred to me that this may be a case wher a violin plot could work.

Any suggestions on how to do this?