code: def daily_plots(
      df,
      variable,
      renormalize = True,
      plot        = True,
      scatter     = False,
      linestyle   = "-",
      linewidth   = 1,
      s           = 1
      ):
      
      if not df.index.dtype in ["datetime64[ns]", "<M8[ns]", ">M8[ns]"]:
          log.error("index is not datetime")
          return False
      days = []
      for group in df.groupby(df.index.day):
          days.append(group[1])
      scaler = MinMaxScaler()
      plt.xlabel("hours")
      plt.ylabel(variable);
      for day in days:
          if renormalize:
              values = scaler.fit_transform(day[[variable]])
          else:
              values = day[variable]
          if plot:
              plt.plot(day["hours_through_day"], values, linestyle = linestyle, linewidth = linewidth)
          if scatter:
              plt.scatter(day["hours_through_day"], values, s = s)
docs: Create daily plots of a variable in a DataFrame, optionally renormalized. It
      is assumed that the DataFrame index is datetime.