from pyclaw.data import ClawPlotData from pyclaw.plotting import plotframe plotdata = ClawPlotData() plotdata.outdir = '.' # Figure: plotfigure = plotdata.new_plotfigure(name='Solution', figno=1) plotfigure.kwargs = {'figsize':[5,3]} # Axes: plotaxes = plotfigure.new_plotaxes(name='Strain') #plotaxes.xlim = [73,79] plotitem = plotaxes.new_plotitem(name='SharpClaw 3600', plot_type='1d') plotitem.plot_var = 0 # q[2] is the stress plotitem.plotstyle = 's' plotitem.color = 'b' # could use 'r' or 'red' or '[1,0,0]' plotitem.kwargs = {'linewidth':3,'markersize':10} plotitem = plotaxes.new_plotitem(name='ClawPack 3600', plot_type='1d') plotitem.outdir = '/users/ketch/research/claw42/fwave2/3600' plotitem.plot_var = 0 # q[2] is the stress plotitem.plotstyle = 'o' plotitem.color = 'r' plotitem.kwargs = {'linewidth':3,'markersize':10} #plotitem = plotaxes.new_plotitem(name='ClawPack 28800', plot_type='1d') #plotitem.outdir = '/users/ketch/research/claw42/fwave2/' #plotitem.plot_var = 0 # q[2] is the stress #plotitem.plotstyle = '-'
def plotclaw(): """ Basic plotting script. Execute from unix by $ python plotclaw.py Additional plot parameters are set in setplot.py. """ from pyclaw.data import ClawPlotData from pyclaw.plotting import printframes plotdata = ClawPlotData() plotdata.plotdir = 'plots' # directory where plots will appear plotdata.setplot = True # so that setplot.py will be called to initialize # Parameters used only when creating html and/or pdf hardcopy # via pyclaw.plotting.printframes: plotdata.printfigs = True # print figures? plotdata.print_format = 'png' # file format plotdata.print_framenos = 'all' # list of frames to print plotdata.print_fignos = 'all' # list of figures to print plotdata.html = True # create html files of plots? plotdata.latex = True # create latex file of plots? plotdata.latex_framesperline = 1 # layout of plots plotdata.latex_figsperline = 2 # layout of plots plotdata.latex_pdf = False # also run pdflatex? # create html files of plots: printframes(plotdata, verbose=False)
def plotclaw(): """ Basic plotting script. Execute from unix by $ python plotclaw.py Additional plot parameters are set in setplot.py. """ from pyclaw.data import ClawPlotData from pyclaw.plotting import printframes plotdata = ClawPlotData() plotdata.setplot = 'setplot.py' # module containing setplot function # to initialize plotting parameters # Parameters used only when creating html and/or pdf hardcopy # via pyclaw.plotting.printframes: plotdata.plotdir = 'plots' # directory where plots will appear plotdata.printfigs = True # print figures plotdata.print_format = 'png' # file format plotdata.print_framenos = 'all' # list of frames to print plotdata.print_fignos = 'all' # list of figures to print plotdata.html = True # create html files of plots? plotdata.latex = True # create latex file of plots? plotdata.latex_framesperline = 2 # layout of plots plotdata.latex_pdf = False # also run pdflatex? # create html files of plots: printframes(plotdata, verbose=False)
from pyclaw.data import ClawPlotData from pyclaw.plotting import plotframe from pylab import hold, clf, plot clf() plotdata = ClawPlotData() plotdata.outdir = './tr7200' # Figure: plotfigure = plotdata.new_plotfigure(name='Solution', figno=1) plotfigure.kwargs = {'figsize':[5,3]} # Axes: plotaxes = plotfigure.new_plotaxes(name='Stress') plotaxes.xlim = [30,55] plotitem = plotaxes.new_plotitem(name='SharpClaw 3600', plot_type='1d') plotitem.plot_var = 2 # q[2] is the stress plotitem.plotstyle = '-' plotitem.color = 'k' # could use 'r' or 'red' or '[1,0,0]' plotitem.kwargs = {'linewidth':3,'markersize':5} #plotitem = plotaxes.new_plotitem(name='ClawPack 3600', plot_type='1d') #plotitem.outdir = '/users/ketch/research/claw42/fwave2/tr28800' #plotitem.plot_var = 2 # q[2] is the stress #plotitem.plotstyle = '-' #plotitem.color = 'k' #plotitem.kwargs = {'linewidth':3,'markersize':5} #plotitem = plotaxes.new_plotitem(name='ClawPack 28800', plot_type='1d') #plotitem.outdir = '/users/ketch/research/claw42/fwave2/'