Skip to content

Commit

Permalink
Plot objective legend (#23)
Browse files Browse the repository at this point in the history
* Objective plot legend
  • Loading branch information
N-Wouda authored Feb 26, 2020
1 parent 01afe65 commit 2bb17bc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions alns/Result.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ def plot_objectives(self, ax=None, title=None, **kwargs):
ax.set_ylabel("Objective value")
ax.set_xlabel("Iteration (#)")

ax.legend(["Current", "Best"], loc="upper right")

plt.draw_if_interactive()

def plot_operator_counts(self, figure=None, title=None, legend=None,
Expand Down
2 changes: 2 additions & 0 deletions alns/tests/test_result.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ def get_objective_plot(ax, data, **kwargs):
ax.set_ylabel("Objective value")
ax.set_xlabel("Iteration (#)")

ax.legend(["Current", "Best"], loc="upper right")


def get_operator_plot(figure, destroy, repair, legend=None, suptitle=None,
**kwargs):
Expand Down

0 comments on commit 2bb17bc

Please sign in to comment.