Skip to content
Snippets Groups Projects
Commit f460356e authored by Oscar Gustafsson's avatar Oscar Gustafsson :bicyclist:
Browse files

Only use integer xticks in schedule

parent 9e23924a
No related branches found
No related tags found
2 merge requests!71Better schedule, including plotting,!69Some basic functionality for plotting a schedule
......@@ -6,6 +6,7 @@ Contains the schema class for scheduling operations in an SFG.
from collections import defaultdict
from typing import Dict, List, Optional
import matplotlib.pyplot as plt
from matplotlib.ticker import MaxNLocator
import numpy as np
from scipy import interpolate
import sys
......@@ -247,6 +248,7 @@ class Schema:
plt.yticks(ytickpositions, yticklabels)
plt.axis([-1, self._schedule_time+1, 0, ypos])
plt.gca().xaxis.set_major_locator(MaxNLocator(integer=True))
plt.plot([0, 0], [0, ypos], linestyle='--', color='black')
plt.plot([self._schedule_time, self._schedule_time], [0, ypos], linestyle='--', color='black')
plt.show()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment