def _modify_axis( ax: Subplot, time: list, data: list, *, color: str, label: str, ): ax.set_ylabel(label, color=color) if isinstance(time[0], list): for plot in zip(time, data): ax.plot(*plot) else: ax.plot(time, data, color=color) ax.tick_params(axis='y', labelcolor=color) ax.xaxis.set_major_locator(mdates.MinuteLocator(interval=5)) ax.xaxis.set_major_formatter(mdates.DateFormatter("%H:%M"))