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 e700133
Show file tree
Hide file tree
Showing 2 changed files with 9 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
9 changes: 8 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,14 @@ def plot_t_rads(self):
ax.set_xlabel("Shell id")
ax.set_ylabel("t_rads")

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

ax.legend(loc="lower left", shadow=True)
error_ax = ax.twinx()
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)")
error_ax.legend(loc="lower right", shadow=True)
return figure

0 comments on commit e700133

Please sign in to comment.