- main_plot=lhc.PlotObject()
- main_plot.add_set(range(len(red_data)),red_data)
- main_plot.add_set(range(len(blue_data)),blue_data)
- main_plot.normalize_vectors()
- main_plot.units=['time','count'] #FIXME: if there's an header saying something about the time count, should be used
- main_plot.destination=0
- main_plot.title=self.filename
- main_plot.colors=['red','blue']
+ extension = lib.curve.Curve()
+ retraction = lib.curve.Curve()
+
+ extension.color = 'red'
+ extension.label = 'extension'
+ extension.style = 'plot'
+ extension.title = 'Force curve'
+ #FIXME: if there's an header saying something about the time count, should be used
+ #TODO: time is not really a unit
+ extension.units.x = 'time'
+ extension.units.y = 'count'
+ extension.x = range(len(red_data))
+ extension.y = red_data
+ retraction.color = 'blue'
+ retraction.label = 'retraction'
+ retraction.style = 'plot'
+ retraction.title = 'Force curve'
+ #FIXME: if there's an header saying something about the time count, should be used
+ #TODO: time is not really a unit
+ retraction.units.x = 'time'
+ retraction.units.y = 'count'
+ retraction.x = range(len(blue_data))
+ retraction.y = blue_data
+
+ plot = lib.plot.Plot()
+ plot.title = os.path.basename(self.filename)
+ plot.curves.append(extension)
+ plot.curves.append(retraction)
+
+ plot.normalize()
+ return plot