Closed rjleveque closed 9 years ago
Could we instead do the following?
def make_legend(current_data):
import matplotlib.pyplot as plt
plt.legend(('2d data', '1d reference solution'))
plotaxes.afteraxes = make_legend
Thinking more broadly, it seems like afteraxes and similar functions ought to take an axes object as argument, right?
In the past I have done a call to gca
which seems to work most of the time to get the axes in question. I would favor putting a bit more into the calling sequence to make this more robust though.
I made the change @ketch suggested.
Rather than axes being a separate argument of afteraxes, it should probably be an attribute of current_data
set by frametools.
I created clawpack/visclaw#138 for discussion.
Also cleaned up comments to reference visclaw rather than pyclaw.