0

I am trying to use the axvline function to plot datetime.time values and seeing this error. please help.

time_ret = datetime.time(11,15)
ax1 = axvline(time_ret, ...)

The error I get:

TypeError: '>' not supported between instances of 'float' and 'datetime.time' 

I see a lot of solution to this issue but all of them answer to this issue by plotting axvline on datetime.date.

I have added a code for the reference. Please help

aditya
  • 13
  • 4
  • 1
    Could you expand your code to show us the full traceback of the error and the full call to `axvline`? And why do the other solutions not work (couldn't you just use `datetime.date` instead of `datetime.time`)? – rassar Oct 07 '22 at 15:05
  • `enter code here` >import datetime as dt >from datetime import datetime >import matplotlib.pyplot as plt >i='wpt' >x = [datetime.time(12,10,10), datetime.time(12, 10, 10)] >axs[i].axvline(x[0], color = 'lightskyblue', ls = '--', lw = 1) – aditya Nov 01 '22 at 11:59

0 Answers0