Skip to content
Snippets Groups Projects
Commit 38481d4f authored by Tammo Jan Dijkema's avatar Tammo Jan Dijkema
Browse files

Fix formatting

parent 6ffbfabc
No related branches found
No related tags found
No related merge requests found
......@@ -14,8 +14,7 @@ import matplotlib
import matplotlib.pyplot as plt
from matplotlib.widgets import Button, CheckButtons
from matplotlib.collections import LineCollection
from matplotlib.ticker import FuncFormatter
from matplotlib.dates import HourLocator, date2num, num2date, AutoDateLocator
from matplotlib.dates import date2num, num2date, AutoDateFormatter
from matplotlib.figure import Figure
from PyQt5.QtWidgets import QApplication, QMainWindow, QVBoxLayout, QWidget, QComboBox
......@@ -42,10 +41,13 @@ class PowerPlot:
self.ax.set_xlabel("Time (UTC)")
self.ax.set_ylabel(yname)
self.ax.xaxis_date()
formatter = AutoDateFormatter(self.ax.xaxis.get_major_locator())
formatter.scaled[1 / (24 * 60)] = "%H:%M"
self.ax.xaxis.set_major_formatter(formatter)
self.min, self.max = None, None
self.ax.xaxis.set_major_formatter(
FuncFormatter(lambda x, pos: f"{num2date(x):%H:%M}")
)
fig.suptitle(yname, fontsize=16)
fig.tight_layout()
(self.totalplot,) = self.ax.plot([], [], ".", color="blue")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment