def plot_fgmax_grid(): fg = fgmax_tools.FGmaxGrid() fg.read_input_data('fgmax_grid1.txt') fg.read_output() #clines_zeta = [0.01] + list(numpy.linspace(0.05,0.3,6)) + [0.5,1.0,10.0] clines_zeta = [0.001] + list(numpy.linspace(0.05,0.25,10)) colors = geoplot.discrete_cmap_1(clines_zeta) plt.figure(1) plt.clf() zeta = numpy.where(fg.B>0, fg.h, fg.h+fg.B) # surface elevation in ocean plt.contourf(fg.X,fg.Y,zeta,clines_zeta,colors=colors) plt.colorbar() plt.contour(fg.X,fg.Y,fg.B,[0.],colors='k') # coastline # plot arrival time contours and label: arrival_t = fg.arrival_time/3600. # arrival time in hours #clines_t = numpy.linspace(0,8,17) # hours clines_t = numpy.linspace(0,2,5) # hours #clines_t_label = clines_t[::2] # which ones to label clines_t_label = clines_t[::1] # which ones to label clines_t_colors = ([.5,.5,.5],) con_t = plt.contour(fg.X,fg.Y,arrival_t, clines_t,colors=clines_t_colors) plt.clabel(con_t, clines_t_label) # fix axes: plt.ticklabel_format(format='plain',useOffset=False) plt.xticks(rotation=20) plt.gca().set_aspect(1./numpy.cos(fg.Y.mean()*numpy.pi/180.)) plt.title("Maximum amplitude / arrival times (hrs)")
def plot_fgmax_grid(fgno): fg = fgmax_tools.FGmaxGrid() fname = 'fgmax_grid%s.txt' % fgno fg.read_input_data(fname) fg.read_output(fgno) clines_zeta = [0.01] + list(numpy.linspace(.3, 2.1, 7)) colors = geoplot.discrete_cmap_1(clines_zeta) plt.figure(fgno) plt.clf() # set zeta = max depth on shore, max surface elevation offshore: zeta = numpy.where(fg.B > 0, fg.h, fg.h + fg.B) plt.contourf(fg.X, fg.Y, zeta, clines_zeta, colors=colors, extend='max') plt.colorbar(extend='max') #plt.contour(fg.X,fg.Y,fg.B,[0.],colors='k') # coastline # plot original coastline extending beyond fgmax region: theta = numpy.linspace(-numpy.pi / 8., 3 / 8. * numpy.pi, 1000) plt.plot(90 * numpy.cos(theta), 90 * numpy.sin(theta), 'k') # fix axes: plt.ticklabel_format(format='plain', useOffset=False) plt.xticks(rotation=20) plt.gca().set_aspect(1. / numpy.cos(fg.Y.mean() * numpy.pi / 180.)) plt.title("Zeta = max depth or surface elevation") plt.axis('scaled') if fgno == 1: plt.axis([85, 95, -5, 5]) else: plt.axis([59, 69, 59, 69])
def plot_fgmax_grid(): fg = fgmax_tools.FGmaxGrid() fg.read_input_data('fgmax_grid.txt') fg.read_output() clines_zeta = [0.01] + list(numpy.linspace(0.05,0.3,6)) + [0.5,1.0,10.0] colors = geoplot.discrete_cmap_1(clines_zeta) plt.figure(1) plt.clf() zeta = numpy.where(fg.B>0, fg.h, fg.h+fg.B) # surface elevation in ocean plt.contourf(fg.X,fg.Y,zeta,clines_zeta,colors=colors) plt.colorbar() plt.contour(fg.X,fg.Y,fg.B,[0.],colors='k') # coastline # plot arrival time contours and label: arrival_t = fg.arrival_time/3600. # arrival time in hours clines_t = numpy.linspace(0,8,17) # hours clines_t_label = clines_t[::2] # which ones to label clines_t_colors = ([.5,.5,.5],) con_t = plt.contour(fg.X,fg.Y,arrival_t, clines_t,colors=clines_t_colors) plt.clabel(con_t, clines_t_label) # fix axes: plt.ticklabel_format(format='plain',useOffset=False) plt.xticks(rotation=20) plt.gca().set_aspect(1./numpy.cos(fg.Y.mean()*numpy.pi/180.)) plt.title("Maximum amplitude / arrival times")
def plot_fgmax_grid(fname, fgno, xl, xu, yl, yu): """Plots the fg_max data using clawpack and creates a figure in the _plots directory""" xlower = xl xupper = xu ylower = yl yupper = yu fg = fgmax_tools.FGmaxGrid() fg.read_fgmax_grids_data(3) fg.read_output(fgno=fgno) clines_zeta = [0.01] + list(np.linspace(0.25, 6, 24)) colors = geoplot.discrete_cmap_1(clines_zeta) zeta = np.where(fg.B > 0, fg.h, fg.h + fg.B) # surface elevation in ocean fig, ax = gearth_fig(llcrnrlon=xlower, llcrnrlat=ylower, urcrnrlon=xupper, urcrnrlat=yupper, pixels=1024) ax.contourf(fg.X, fg.Y, zeta, clines_zeta, colors=colors, alpha=.90) ax.contour(fg.X, fg.Y, fg.B, [0.], colors='k') # coastline # fix axes: ax.ticklabel_format(style='plain', useOffset=False) plt.xticks(rotation=20) plt.gca().set_aspect(1. / np.cos(fg.Y.mean() * np.pi / 180.)) plt.title("Maximum amplitude") cs = ax.contourf(fg.X, fg.Y, zeta, clines_zeta, colors=colors) return (cs)
def plot_fgmax_grid(fgno): fg = fgmax_tools.FGmaxGrid() fname = 'fgmax_grid%s.txt' % fgno fg.read_input_data(fname) fg.read_output(fgno) clines_zeta = [0.01] + list(numpy.linspace(.3, 2.1, 7)) colors = geoplot.discrete_cmap_1(clines_zeta) plt.figure(fgno) plt.clf() # set zeta = max depth on shore, max surface elevation offshore: zeta = numpy.where(fg.B>0, fg.h, fg.h+fg.B) plt.contourf(fg.X,fg.Y,zeta,clines_zeta,colors=colors,extend='max') plt.colorbar(extend='max') #plt.contour(fg.X,fg.Y,fg.B,[0.],colors='k') # coastline # plot original coastline extending beyond fgmax region: theta = numpy.linspace(-numpy.pi/8., 3/8. *numpy.pi, 1000) plt.plot(90*numpy.cos(theta), 90*numpy.sin(theta), 'k') # fix axes: plt.ticklabel_format(format='plain',useOffset=False) plt.xticks(rotation=20) plt.gca().set_aspect(1./numpy.cos(fg.Y.mean()*numpy.pi/180.)) plt.title("Zeta = max depth or surface elevation") plt.axis('scaled') if fgno==1: plt.axis([85,95,-5,5]) else: plt.axis([59,69,59,69])
def plot_fgmax_grid(): fg = fgmax_tools.FGmaxGrid() fg.read_input_data('fgmax_grid1.txt') fg.read_output() #clines_zeta = [0.01] + list(numpy.linspace(0.05,0.3,6)) + [0.5,1.0,10.0] clines_zeta = [0.001] + list(numpy.linspace(0.05, 0.25, 10)) colors = geoplot.discrete_cmap_1(clines_zeta) plt.figure(1) plt.clf() zeta = numpy.where(fg.B > 0, fg.h, fg.h + fg.B) # surface elevation in ocean plt.contourf(fg.X, fg.Y, zeta, clines_zeta, colors=colors) plt.colorbar() plt.contour(fg.X, fg.Y, fg.B, [0.], colors='k') # coastline # draw better land import clawpack.geoclaw.topotools as tt topo = tt.Topography(path='../bathy/atlantic_2min.tt3') shore = topo.make_shoreline_xy() plt.plot(shore[:, 0], shore[:, 1], 'k', linewidth=10) # plot arrival time contours and label: arrival_t = fg.arrival_time / 3600. # arrival time in hours #clines_t = numpy.linspace(0,8,17) # hours clines_t = numpy.linspace(0, 2, 5) # hours #clines_t_label = clines_t[::2] # which ones to label clines_t_label = clines_t[::1] # which ones to label clines_t_colors = ([.5, .5, .5], ) con_t = plt.contour(fg.X, fg.Y, arrival_t, clines_t, colors=clines_t_colors) plt.clabel(con_t, clines_t_label) # fix axes: plt.ticklabel_format(format='plain', useOffset=False) plt.xticks(rotation=20) plt.gca().set_aspect(1. / numpy.cos(fg.Y.mean() * numpy.pi / 180.)) plt.title("Maximum amplitude / arrival times (hrs)")
def plot_fgmax_grid(): fg = fgmax_tools.FGmaxGrid() fg.read_input_data('fgmax_grid1.txt') fg.read_output() #clines_zeta = [0.01] + list(numpy.linspace(0.05,0.3,6)) + [0.5,1.0,10.0] clines_zeta = [0.001] + list(numpy.linspace(0.05,0.25,10)) colors = geoplot.discrete_cmap_1(clines_zeta) plt.figure(1) plt.clf() zeta = numpy.where(fg.B>0, fg.h, fg.h+fg.B) # surface elevation in ocean plt.contourf(fg.X,fg.Y,zeta,clines_zeta,colors=colors) plt.colorbar() plt.contour(fg.X,fg.Y,fg.B,[0.],colors='k') # coastline # draw better land import clawpack.geoclaw.topotools as tt topo = tt.Topography(path='../bathy/atlantic_2min.tt3') shore = topo.make_shoreline_xy() plt.plot(shore[:,0], shore[:,1], 'k', linewidth=10) # plot arrival time contours and label: arrival_t = fg.arrival_time/3600. # arrival time in hours #clines_t = numpy.linspace(0,8,17) # hours clines_t = numpy.linspace(0,2,5) # hours #clines_t_label = clines_t[::2] # which ones to label clines_t_label = clines_t[::1] # which ones to label clines_t_colors = ([.5,.5,.5],) con_t = plt.contour(fg.X,fg.Y,arrival_t, clines_t,colors=clines_t_colors) plt.clabel(con_t, clines_t_label) # fix axes: plt.ticklabel_format(format='plain',useOffset=False) plt.xticks(rotation=20) plt.gca().set_aspect(1./numpy.cos(fg.Y.mean()*numpy.pi/180.)) plt.title("Maximum amplitude / arrival times (hrs)")
def setplot(plotdata): #-------------------------- """ Specify what is to be plotted at each frame. Input: plotdata, an instance of pyclaw.plotters.data.ClawPlotData. Output: a modified version of plotdata. """ from clawpack.visclaw import colormaps, geoplot from numpy import linspace plotdata.clearfigures() # clear any old figures,axes,items data plotdata.format = 'binary' # To plot gauge locations on pcolor or contour plot, use this as # an afteraxis function: def addgauges(current_data): from clawpack.visclaw import gaugetools gaugetools.plot_gauge_locations(current_data.plotdata, \ gaugenos='all', format_string='ko', add_labels=False) def fixup(current_data): import pylab #addgauges(current_data) t = current_data.t t = t / 3600. # hours pylab.title('Surface at %4.2f hours' % t, fontsize=20) pylab.ticklabel_format(format='plain',useOffset=False) mean_lat = 19.7 pylab.gca().set_aspect(1.0 / pylab.cos(pylab.pi / 180.0 * mean_lat)) #pylab.xticks(fontsize=15) #pylab.yticks(fontsize=15) #----------------------------------------- # Figure for imshow plot #----------------------------------------- plotfigure = plotdata.new_plotfigure(name='Pacific', figno=1) #plotfigure.show = False # Set up for axes in this figure: plotaxes = plotfigure.new_plotaxes('imshow') plotaxes.title = 'Surface' #plotaxes.scaled = True plotaxes.afteraxes = fixup # Water plotitem = plotaxes.new_plotitem(plot_type='2d_imshow') # plotitem.plot_var = geoplot.surface plotitem.plot_var = geoplot.surface_or_depth plotitem.imshow_cmap = geoplot.tsunami_colormap plotitem.imshow_cmin = -0.2 plotitem.imshow_cmax = 0.2 plotitem.add_colorbar = True plotitem.amr_celledges_show = [0,0,0] plotitem.patchedges_show = 0 # Land plotitem = plotaxes.new_plotitem(plot_type='2d_imshow') plotitem.plot_var = geoplot.land plotitem.imshow_cmap = geoplot.land_colors plotitem.imshow_cmin = 0.0 plotitem.imshow_cmax = 100.0 plotitem.add_colorbar = False plotitem.amr_celledges_show = [0,0,0] plotitem.patchedges_show = 0 plotaxes.xlimits = [135,210] plotaxes.ylimits = [9,53] # add contour lines of bathy if desired: plotitem = plotaxes.new_plotitem(plot_type='2d_contour') plotitem.show = False plotitem.plot_var = geoplot.topo plotitem.contour_levels = linspace(-2000,0,5) plotitem.amr_contour_colors = ['y'] # color on each level plotitem.kwargs = {'linestyles':'solid','linewidths':2} plotitem.amr_contour_show = [1,0,0] plotitem.celledges_show = 0 plotitem.patchedges_show = 0 #----------------------------------------- # Figure for zoom plot #----------------------------------------- plotfigure = plotdata.new_plotfigure(name='Hawaii', figno=20) #plotfigure.show = False # Set up for axes in this figure: plotaxes = plotfigure.new_plotaxes('imshow') plotaxes.title = 'Surface' #plotaxes.scaled = True plotaxes.afteraxes = fixup # Water plotitem = plotaxes.new_plotitem(plot_type='2d_imshow') # plotitem.plot_var = geoplot.surface plotitem.plot_var = geoplot.surface_or_depth plotitem.imshow_cmap = geoplot.tsunami_colormap plotitem.imshow_cmin = -0.2 plotitem.imshow_cmax = 0.2 plotitem.add_colorbar = True plotitem.amr_celledges_show = [0,0,0] plotitem.patchedges_show = 0 # Land plotitem = plotaxes.new_plotitem(plot_type='2d_imshow') plotitem.plot_var = geoplot.land plotitem.imshow_cmap = geoplot.land_colors plotitem.imshow_cmin = 0.0 plotitem.imshow_cmax = 100.0 plotitem.add_colorbar = False plotitem.amr_celledges_show = [0,0,0] plotitem.patchedges_show = 0 plotaxes.xlimits = [200., 208.] plotaxes.ylimits = [17, 25] #----------------------------------------- # Figure for zoom plot #----------------------------------------- plotfigure = plotdata.new_plotfigure(name='zoom', figno=2) plotfigure.show = False # Set up for axes in this figure: plotaxes = plotfigure.new_plotaxes('imshow') plotaxes.title = 'Surface' #plotaxes.scaled = True plotaxes.afteraxes = fixup # Water plotitem = plotaxes.new_plotitem(plot_type='2d_imshow') # plotitem.plot_var = geoplot.surface plotitem.plot_var = geoplot.surface_or_depth plotitem.imshow_cmap = geoplot.tsunami_colormap plotitem.imshow_cmin = -0.2 plotitem.imshow_cmax = 0.2 plotitem.add_colorbar = True plotitem.amr_celledges_show = [0,0,0] plotitem.patchedges_show = 0 # Land plotitem = plotaxes.new_plotitem(plot_type='2d_imshow') plotitem.plot_var = geoplot.land plotitem.imshow_cmap = geoplot.land_colors plotitem.imshow_cmin = 0.0 plotitem.imshow_cmax = 100.0 plotitem.add_colorbar = False plotitem.amr_celledges_show = [0,0,0] plotitem.patchedges_show = 0 plotaxes.xlimits = [204.8, 205.] plotaxes.ylimits = [19.7, 19.9] #----------------------------------------- # Figure for zoom plot #----------------------------------------- plotfigure = plotdata.new_plotfigure(name='Hilo', figno=3) # Set up for axes in this figure: plotaxes = plotfigure.new_plotaxes('imshow') plotaxes.title = 'Surface' #plotaxes.scaled = True plotaxes.afteraxes = fixup # Water plotitem = plotaxes.new_plotitem(plot_type='2d_imshow') #plotitem.show = False # plotitem.plot_var = geoplot.surface plotitem.plot_var = geoplot.surface_or_depth plotitem.imshow_cmap = geoplot.tsunami_colormap plotitem.imshow_cmin = -0.5 plotitem.imshow_cmax = 0.5 plotitem.add_colorbar = True plotitem.amr_celledges_show = [0,0,0] plotitem.patchedges_show = 0 # Land plotitem = plotaxes.new_plotitem(plot_type='2d_imshow') plotitem.plot_var = geoplot.land plotitem.imshow_cmap = geoplot.land_colors plotitem.imshow_cmin = 0.0 plotitem.imshow_cmax = 100.0 plotitem.add_colorbar = False plotitem.amr_celledges_show = [0,0,0] plotitem.patchedges_show = 0 plotaxes.xlimits = [204.9, 204.96] plotaxes.ylimits = [19.72, 19.76] # add contour lines of bathy if desired: plotitem = plotaxes.new_plotitem(plot_type='2d_contour') plotitem.show = False plotitem.plot_var = geoplot.topo plotitem.contour_levels = linspace(-2000,0,5) plotitem.amr_contour_colors = ['y'] # color on each level plotitem.kwargs = {'linestyles':'solid','linewidths':2} plotitem.amr_contour_show = [1,0,0] plotitem.celledges_show = 0 plotitem.patchedges_show = 0 #----------------------------------------- # Figure for speed #----------------------------------------- plotfigure = plotdata.new_plotfigure(name='speed1', figno=4) plotfigure.show = False def speed(current_data): from numpy import ma, where, sqrt drytol = 1e-3 q = current_data.q h = q[0,:,:] hu = q[1,:,:] hv = q[2,:,:] speed = where(h > drytol, sqrt(hu**2 + hv**2)/h**2, 0.) speed = ma.masked_where(h<=drytol, speed) return speed # Set up for axes in this figure: plotaxes = plotfigure.new_plotaxes() plotaxes.title = 'Speed' #plotaxes.scaled = True def fixup(current_data): import pylab #addgauges(current_data) t = current_data.t t = t / 3600. # hours pylab.title('Speed at %4.2f hours' % t, fontsize=20) pylab.ticklabel_format(format='plain',useOffset=False) mean_lat = 19.7 pylab.gca().set_aspect(1.0 / pylab.cos(pylab.pi / 180.0 * mean_lat)) plotaxes.afteraxes = fixup # Water (contourf not working) plotitem = plotaxes.new_plotitem(plot_type='2d_contourf') plotitem.show = False plotitem.plot_var = speed clines = [0, 0.01, 0.02, 0.04, 0.06, 0.08, 0.1, 0.2] plotitem.contour_levels = clines from clawpack.geoclaw.geoplot import discrete_cmap_1 plotitem.fill_colors = discrete_cmap_1(clines) plotitem.kwargs = {'extend':'max'} plotitem.add_colorbar = True plotitem.amr_celledges_show = 0 plotitem.patchedges_show = 0 plotitem = plotaxes.new_plotitem(plot_type='2d_imshow') plotitem.plot_var = speed plotitem.imshow_cmap = geoplot.tsunami_colormap plotitem.imshow_cmin = 0.0 plotitem.imshow_cmax = 0.3 plotitem.add_colorbar = True plotitem.amr_celledges_show = [0,0,0] plotitem.patchedges_show = 0 # Land plotitem = plotaxes.new_plotitem(plot_type='2d_imshow') #plotitem.show = False plotitem.plot_var = geoplot.land plotitem.imshow_cmap = geoplot.land_colors plotitem.imshow_cmin = 0.0 plotitem.imshow_cmax = 100.0 plotitem.add_colorbar = False plotitem.amr_celledges_show = [0,0,0] plotitem.patchedges_show = 0 plotaxes.xlimits = [204.9, 204.96] plotaxes.ylimits = [19.72, 19.76] # add contour lines of bathy if desired: plotitem = plotaxes.new_plotitem(plot_type='2d_contour') plotitem.show = False plotitem.plot_var = geoplot.topo plotitem.contour_levels = linspace(-2000,0,5) plotitem.amr_contour_colors = ['y'] # color on each level plotitem.kwargs = {'linestyles':'solid','linewidths':2} plotitem.amr_contour_show = [1,0,0] plotitem.celledges_show = 0 plotitem.patchedges_show = 0 #----------------------------------------- # Figure for velocity plot #----------------------------------------- plotfigure = plotdata.new_plotfigure(name='Speed', figno=10) #plotfigure.show = False # Set up for axes for velocity plotaxes = plotfigure.new_plotaxes() #plotaxes.axescmd = 'subplot(212)' plotaxes.title = 'Speed' plotaxes.scaled = True def fixup(current_data): import pylab addgauges(current_data) t = current_data.t t = t / 3600. # hours pylab.title('Speed at %4.2f hours' % t, fontsize=20) pylab.ticklabel_format(format='plain',useOffset=False) mean_lat = 19.7 pylab.gca().set_aspect(1.0 / pylab.cos(pylab.pi / 180.0 * mean_lat)) pylab.xticks(rotation=20) plotaxes.afteraxes = fixup plotaxes.xlimits = [204.9, 204.96] plotaxes.ylimits = [19.72, 19.76] def speed(current_data): from pylab import where,sqrt q = current_data.q h = q[0,:,:] dry_tol = 0.001 u = where(h>dry_tol, q[1,:,:]/h, 0.) v = where(h>dry_tol, q[2,:,:]/h, 0.) s = sqrt(u**2 + v**2) return s # Water plotitem = plotaxes.new_plotitem(plot_type='2d_imshow') plotitem.plot_var = speed #plotitem.imshow_cmap = colormaps.white_red #plotitem.imshow_cmap = colormaps.yellow_red_blue plotitem.imshow_cmap = \ colormaps.make_colormap({0:[1,1,1],0.5:[0.1,0.1,1],1:[1,0.1,0.1]}) plotitem.imshow_cmin = 0. plotitem.imshow_cmax = 1.0 plotitem.add_colorbar = True plotitem.colorbar_shrink = 0.6 plotitem.amr_celledges_show = [0] plotitem.amr_patchedges_show = [0] #----------------------------------------- # Figures for gauges #----------------------------------------- plotfigure = plotdata.new_plotfigure(name='Surface', figno=300, \ type='each_gauge') plotfigure.clf_each_gauge = True # Set up for axes in this figure: plotaxes = plotfigure.new_plotaxes() #plotaxes.axescmd = 'subplot(2,1,1)' plotaxes.title = 'Surface' # Plot surface as blue curve: plotitem = plotaxes.new_plotitem(plot_type='1d_plot') plotitem.plot_var = 3 plotitem.plotstyle = 'b-' plotitem.kwargs = {'linewidth':2} # Plot topo as green curve: plotitem = plotaxes.new_plotitem(plot_type='1d_plot') plotitem.show = False def gaugetopo(current_data): q = current_data.q h = q[0,:] eta = q[3,:] topo = eta - h return topo plotitem.plot_var = gaugetopo plotitem.plotstyle = 'g-' def add_zeroline(current_data): from pylab import plot, legend, xticks, floor, xlim,ylim t = current_data.t #legend(('surface','topography'),loc='lower left') plot(t, 0*t, 'k') n = int(floor(t.max()/1800.)) + 2 xticks([1800*i for i in range(n)],[str(0.5*i) for i in range(n)]) xlim(25000,t.max()) #ylim(-0.5,0.5) print "+++ gaugeno = ",current_data.gaugeno #plotaxes.ylimits = [-0.5, 0.5] plotaxes.afteraxes = add_zeroline plotfigure = plotdata.new_plotfigure(name='Velocities', figno=301, \ type='each_gauge') plotfigure.clf_each_gauge = True plotaxes = plotfigure.new_plotaxes() #plotaxes.axescmd = 'subplot(2,1,2)' plotaxes.title = 'Velocities' #plotaxes.afteraxes = add_zeroline # Plot velocity as red curve: plotitem = plotaxes.new_plotitem(plot_type='1d_plot') plotitem.show = False def speed(current_data): from numpy import where, sqrt h = current_data.q[0,:] h = where(h>0.01, h, 1.e6) u = 100. * current_data.q[1,:] / h v = 100. * current_data.q[2,:] / h s = sqrt(u**2 + v**2) return s plotitem.plot_var = speed plotitem.plotstyle = 'k-' plotitem = plotaxes.new_plotitem(plot_type='1d_plot') def uvel(current_data): from numpy import where, sqrt h = current_data.q[0,:] h = where(h>0.01, h, 1.e6) u = 100. * current_data.q[1,:] / h return u plotitem.plot_var = uvel plotitem.plotstyle = 'r-' plotitem.kwargs = {'linewidth':2} plotitem = plotaxes.new_plotitem(plot_type='1d_plot') def vvel(current_data): from numpy import where, sqrt h = current_data.q[0,:] h = where(h>0.01, h, 1.e6) v = 100. * current_data.q[2,:] / h return v plotitem.plot_var = vvel plotitem.plotstyle = 'g-' plotitem.kwargs = {'linewidth':2} def add_legend(current_data): from pylab import legend legend(['u','v'],'upper left') #legend(['Speed','u','v'],'upper left') add_zeroline(current_data) plotaxes.ylimits = [-50,50] plotaxes.afteraxes = add_legend #----------------------------------------- # Parameters used only when creating html and/or latex hardcopy # e.g., via pyclaw.plotters.frametools.printframes: plotdata.printfigs = True # print figures plotdata.print_format = 'png' # file format plotdata.print_framenos = 'all' # list of frames to print plotdata.print_gaugenos = 'all' # list of gauges to print plotdata.print_fignos = 'all' # list of figures to print plotdata.html = True # create html files of plots? plotdata.html_homelink = '../README.html' # pointer for top of index plotdata.latex = True # create latex file of plots? plotdata.latex_figsperline = 2 # layout of plots plotdata.latex_framesperline = 1 # layout of plots plotdata.latex_makepdf = False # also run pdflatex? return plotdata