def plot_graph(self, data): x = [i for i in range(0, len(data))] x_data = np.array(x) y_data = np.array(data) app = PlotApp() app.plot(x_data, y_data, title='Compound interest over term', label='Compound interest', ylabel='Funds (£)', xlabel='Time (Months)') app.write_message('Try Help->Quick Reference') app.run()
geo = GeoCalculator(Tsec) geo.Solve() print geo.Area() p = geo.Centroid() alfa = geo.tan_alfa() print p print "a=" + str(alfa) app = PlotApp() Path = DrawGeometry(Tsec) Path.Draw() #newIsec = Isec.moveCoor(-p[0], -p[1]) #origin = Point(0,0) #newIsec = Isec.rotate(pi/4, p) #newIsec = Isec.transform(-p[0],-p[1],-alfa, origin) #geo1 = GeoCalculator(newIsec) #geo1.Solve() #print geo1.Area() #print geo1.Centroid() for i in Path._paths: m,n=zip(*i) app.oplot(m,n,title='Example PlotApp', label='a', ylabel=r'$k^2\chi(k) $', xlabel=r'$ k \ (\AA^{-1}) $') app.write_message('Try Help->Quick Reference') app.run()
#!/usr/bin/python from wxmplot import PlotApp f = open('xafs.dat','r') x = [] y = [] titles = [] for i in f.readlines(): i = i[:-1].strip() if i.startswith('#'): titles.append(i) else: j = i.split() x.append(float(j[0])) y.append(float(j[1])) f.close() app = PlotApp() app.plot(x,y,xlabel='E (eV)', label='As K', marker='+',linewidth=1) app.set_title('Test Plot') app.write_message('MPlot PlotFrame example: Try Help->Quick Reference') app.run()
#!/usr/bin/python from wxmplot import PlotApp f = open('xafs.dat', 'r') x = [] y = [] titles = [] for i in f.readlines(): i = i[:-1].strip() if i.startswith('#'): titles.append(i) else: j = i.split() x.append(float(j[0])) y.append(float(j[1])) f.close() app = PlotApp() app.plot(x, y, xlabel='E (eV)', label='As K', marker='+', linewidth=1) app.set_title('Test Plot') app.write_message('MPlot PlotFrame example: Try Help->Quick Reference') app.run()