#NEWLINE# def plot( series , style = 'line' , label = None , logx = False , logy = False ) : #NEWLINE# #INDENT# global _hold , _chart #NEWLINE# if ( _hold and _chart ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# _chart . addSeries ( series ) #NEWLINE# _chart . plot ( ) #NEWLINE# return #NEWLINE# #UNINDENT# except : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# #UNINDENT# styles = [ 'bar' , 'hist' , 'line' , 'scatter' ] #NEWLINE# if ( style not in styles ) : #NEWLINE# #INDENT# raise ( 'Supported chart styles:' + ',' . join ( styles ) ) #NEWLINE# #UNINDENT# c = None #NEWLINE# if ( style == 'bar' ) : #NEWLINE# #INDENT# c = BarChart ( logx = logx , logy = logy ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( style == 'hist' ) : #NEWLINE# #INDENT# c = Histogram ( logx = logx , logy = logy ) #NEWLINE# raise 'Histogram not supported yet. Please use bar chart' #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( style == 'line' ) : #NEWLINE# #INDENT# c = LineChart ( logx = logx , logy = logy ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( style in 'scatter' ) : #NEWLINE# #INDENT# c = ScatterPlot ( logx = logx , logy = logy ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# c . addSeries ( series ) #NEWLINE# c . plot ( ) #NEWLINE# _chart = c