Administrator approval is now required for registering new accounts. If you are registering a new account, and are external to the University, please ask the repository owner to contact ServiceLine to request your account be approved. Repository owners must include the newly registered email address, and specific repository in the request for approval.

Commit cf32d048 authored by Ed Rogers's avatar Ed Rogers
Browse files

Improve plotting of results

parent 88e4a1da
......@@ -129,7 +129,8 @@ class HearingResults:
self._counter = 0
def as_list(self):
return self._data.tolist()
return self._data
def load_results(self):
self._data = np.loadtxt('data.csv', delimiter=',')
data = np.loadtxt('data.csv', delimiter=',')
self._data = [data[i, :] for i in range(0, data.shape[0])]
......@@ -10,11 +10,11 @@ from matplotlib.figure import Figure
class HearingResultsCanvas(FigureCanvas):
def __init__(self, parent=None, results: HearingResults=None):
self.setParent = parent
fig = Figure()
self.axes = fig.add_subplot(111)
fig.set_facecolor((0., 0., 0.))
# fig.set_facecolor((0., 0., 0.))
FigureCanvas.__init__(self, fig)
self.parent = parent
FigureCanvas.setSizePolicy(self,
QSizePolicy.Expanding,
......@@ -26,6 +26,7 @@ class HearingResultsCanvas(FigureCanvas):
results_list = results.as_list()
n = len(results_list)
pink = np.array((1., 0.7, 0.8))
freqs = self.parent.parent.library.freqs
for i, result in enumerate(results_list):
if n - i > 10:
color = pink
......@@ -34,9 +35,15 @@ class HearingResultsCanvas(FigureCanvas):
color = (pink[0], pink[1] * reduction, pink[2] * reduction)
print(color)
self.axes.plot(result, color=color)
self.axes.semilogx(freqs, result, color=color)
spacing = (HearingTest.upper_lim - HearingTest.lower_lim) / 10
self.axes.set_ylim(HearingTest.lower_lim - spacing, HearingTest.upper_lim + spacing)
labels = [str(b) for b in freqs]
# labels.insert(0, '')
# self.axes.log
self.axes.set_xticks(freqs)
self.axes.set_xticklabels(labels)
self.axes.set_yticks([])
class ResultsWindow(QMainWindow):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment