0

I am trying to use the below dataframe to create horizontal reference lines,

data = pd.DataFrame({'Drug Name':['Katrex','Acyloir','Zelorix'],'Start Date': ['2001-11-13', '2002-6-26', '2004-2-22'],'End Date': ['2002-6-25', '2004-2-21', '2006-8-21']})

In addition to this dataframe, I already have a plot showing trends over time for these drugs so I just need to create the horizontal lines for the drugs. In other words, there will be three horizontal lines in total, one for Katrex, one for Acyloir, and the one for Zelorix. Any help would be appreciated.

yeppi
  • 187
  • 1
  • 8
  • Hi @yappi. I assume the dates would be the x-axis and the drug names would be the y-axis. But, what would the values for y-axis or at least the order in which the horizontal lines would show up? – Redox Jun 28 '22 at 05:40
  • This [answer](https://stackoverflow.com/a/59040003/7758804) shows how to add horizontal lines against a timeseries axis. – Trenton McKinney Jun 28 '22 at 05:50

0 Answers0