def gnuplot(self, cmd=arch.GNUPLOT_CMD, terminal=arch.GNUPLOT_TERMINAL, output=arch.GNUPLOT_OUTPUT, title=None): """Plot rpm vs. torque and rpm vs. power using gnuplot. Optional arguments are: terminal: gnuplot terminal output: gnuplot output cmd: gnuplot command """ gnuplot.plot([self.torque(), self.hp()], ["Torque", "Power"], terminal, output, cmd, title=title)
def gnuplot_manual(self, evt = None): dlg = self.GnuplotDialog(self, -1) if dlg.ShowModal() == wx.ID_OK: data = [] label= [] for i in dlg.selected: data.append(self.runs[i].torque()) data.append(self.runs[i].hp()) label.append("Torque %d" % i) label.append("Power %d" % i) if len(data) > 0: gnuplot.plot(data, terminal = arch.GNUPLOT_TERMINAL, output = arch.GNUPLOT_OUTPUT, labels = label)
def gnuplot_manual(self, evt=None): dlg = self.GnuplotDialog(self, -1) if dlg.ShowModal() == wx.ID_OK: data = [] label = [] for i in dlg.selected: data.append(self.runs[i].torque()) data.append(self.runs[i].hp()) label.append("Torque %d" % i) label.append("Power %d" % i) if len(data) > 0: gnuplot.plot(data, terminal=arch.GNUPLOT_TERMINAL, output=arch.GNUPLOT_OUTPUT, labels=label)
return points if __name__ == "__main__": import random, math points = [] real = [] for i in range(1, 1000): p = (math.sin(i / float(50)) * 200 + i) real.append((i, p)) points.append((i, p + (random.random() - 0.5) * 400)) import gnuplot, time one = NNA(points) gnuplot.plot([points, real, one], terminal="x11", labels=["Raw Data", "Real Curve", "Fit Curve"], output="1.png") time.sleep(3) two = box(points) gnuplot.plot([points, real, two], terminal="x11", labels=["Raw Data", "Real Curve", "Fit Curve"], output="2.png") time.sleep(3) three = RunningAverage(points) gnuplot.plot([points, real, three], terminal="x11", labels=["Raw Data", "Real Curve", "Fit Curve"], output="3.png") time.sleep(3) four = SavGol(points)
def plot( self ): gnuplot.plot( self.gnuplotL )
points.append( (data[i][0], values[i]) ) return points if __name__ == "__main__": import random, math points = [] real = [] for i in range(1,1000): p = (math.sin(i/float(50)) * 200+i) real.append( (i, p) ) points.append( (i, p + (random.random()-0.5)*400 ) ) import gnuplot, time one = NNA(points) gnuplot.plot([points, real, one], terminal = "x11", labels = ["Raw Data", "Real Curve", "Fit Curve"], output = "1.png");time.sleep(3) two = box(points) gnuplot.plot([points, real, two], terminal = "x11", labels = ["Raw Data", "Real Curve", "Fit Curve"], output = "2.png");time.sleep(3) three = RunningAverage(points) gnuplot.plot([points,real, three], terminal = "x11", labels = ["Raw Data", "Real Curve", "Fit Curve"], output = "3.png");time.sleep(3) four = SavGol(points) gnuplot.plot([points,real, four], terminal = "x11", labels = ["Raw Data", "Real Curve", "Fit Curve"],
def go(): dl = datalog("homie.csv", 0, 1, 5) h = histogram(dl.RPM_data(), boxsize=2) gnuplot.plot([h])
def histogram_plot(evt=None): d = data.RPM_data() bs = self.hist_slider.GetValue() h = histogram(d, boxsize=bs) gnuplot.plot([h])
def plot(self): gnuplot.plot(self.gnuplotL)
def go(): dl =datalog("homie.csv", 0, 1, 5) h = histogram(dl.RPM_data(), boxsize=2) gnuplot.plot([h])
def histogram_plot(evt = None): d = data.RPM_data() bs = self.hist_slider.GetValue() h = histogram(d, boxsize = bs) gnuplot.plot([h])