clawpack / classic

Classic single-grid Fortran routines
http://www.clawpack.org
BSD 3-Clause "New" or "Revised" License
11 stars 25 forks source link

Fix afteraxes nopylab #67

Closed rjleveque closed 9 years ago

rjleveque commented 9 years ago

Also cleaned up comments to reference visclaw rather than pyclaw.

ketch commented 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?

mandli commented 9 years ago

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.

rjleveque commented 9 years ago

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.