display a pretty graph
(dataForAllPlots, title, plottype, plotkwargs, xaxislabel, yaxislabel)
| 37 | from fftPerformanceTesting import * |
| 38 | |
| 39 | def 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 ######## |
| 69 | def plotFromDataFile(): |
nothing calls this directly
no outgoing calls
no test coverage detected