clawpack / visclaw

Clawpack visualization tools
http://www.clawpack.org
BSD 3-Clause "New" or "Revised" License
29 stars 47 forks source link

Add beforeaxes attribute to ClawPlotAxes and run it in plot_frame #226

Closed rjleveque closed 6 years ago

rjleveque commented 6 years ago

Useful to plot background image before each time frame plot, e.g. Google Earth image for GeoClaw.

For example, add something like this to the top of setplot.py:

image = plt.imread('image.png')

def background_image(current_data):
    from pylab import imshow
    extent = [x1,x2,y1,y2]
    imshow(image,extent=extent)

and then for some ClawPlotAxes setup:

    plotaxes.beforeaxes = background_image