Skip to content

Commit

Permalink
Add plots for result, reference and error in plot_t_rads.
Browse files Browse the repository at this point in the history
  • Loading branch information
Karan Desai committed Jun 17, 2016
1 parent 1430e41 commit e428796
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
2 changes: 1 addition & 1 deletion tardis/tests/tests_slow/plot_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def upload(self, report):
if report.passed:
axes.text(0.8, 0.8, 'passed', transform=axes.transAxes,
bbox={'facecolor': 'green', 'alpha': 0.5, 'pad': 10})
elif report.failed:
else:
axes.text(0.8, 0.8, 'failed', transform=axes.transAxes,
bbox={'facecolor': 'red', 'alpha': 0.5, 'pad': 10})

Expand Down
14 changes: 13 additions & 1 deletion tardis/tests/tests_slow/test_w7.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,19 @@ def plot_t_rads(self):
ax.set_xlabel("Shell id")
ax.set_ylabel("t_rads")

ax.plot(self.result.t_rads, color="blue", marker=".")
result_line = ax.plot(self.result.t_rads, color="blue",
marker=".", label="Result")
reference_line = ax.plot(self.reference['t_rads'], color="green",
marker=".", label="Reference")
ax.axis([0, 28, 5000, 10000])

error_ax = ax.twinx()
error_line = error_ax.plot((1 - self.result.t_rads / self.reference['t_rads']),
color="red", marker=".", label="Rel. Error")
error_ax.set_ylabel("Relative error (1 - result / reference)")

lines = result_line + reference_line + error_line
labels = [l.get_label() for l in lines]

ax.legend(lines, labels, loc="lower left")
return figure

0 comments on commit e428796

Please sign in to comment.