MCPcopy Create free account
hub / github.com/clMathLibraries/clFFT / plotGraph

Function plotGraph

src/scripts/perf/plotPerformance.py:39–66  ·  view source on GitHub ↗

display a pretty graph

(dataForAllPlots, title, plottype, plotkwargs, xaxislabel, yaxislabel)

Source from the content-addressed store, hash-verified

37from fftPerformanceTesting import *
38
39def plotGraph(dataForAllPlots, title, plottype, plotkwargs, xaxislabel, yaxislabel):
40 """
41 display a pretty graph
42 """
43 dh.write('Making graph\n')
44 colors = ['k','y','m','c','b','r','g']
45 #plottype = 'plot'
46 for thisPlot in dataForAllPlots:
47 getattr(pylab, plottype)(thisPlot.xdata, thisPlot.ydata,
48 '{}.-'.format(colors.pop()),
49 label=thisPlot.label, **plotkwargs)
50 if len(dataForAllPlots) > 1:
51 pylab.legend(loc='best')
52
53 pylab.title(title)
54 pylab.xlabel(xaxislabel)
55 pylab.ylabel(yaxislabel)
56 pylab.grid(True)
57
58 if args.outputFilename == None:
59 # if no pdf output is requested, spit the graph to the screen . . .
60 pylab.show()
61 else:
62 pylab.savefig(args.outputFilename,dpi=(1024/8))
63 # . . . otherwise, gimme gimme pdf
64 #pdf = PdfPages(args.outputFilename)
65 #pdf.savefig()
66 #pdf.close()
67
68######## plotFromDataFile() Function to plot from data file begins ########
69def plotFromDataFile():

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected