#NEWLINE# def make_aes( x = None , y = None , size = None , colour = None , shape = None , alpha = None ) : #NEWLINE# #INDENT# 'Create an empty aesthetics dictionary.\n\n    Parameters:\n    -----------\n    x: string, DataFrame column name\n    y: string, DataFrame column name\n    size: function, binding for size attribute of Geoms\n    colour: function, binding for colour attribute of Geoms\n    shape: function, binding for shape attribute of Geoms\n    alpha: function, binding for alpha attribute of Geoms\n\n    Returns:\n    --------\n    a dictionary with aesthetics bindings\n    ' #NEWLINE# if ( ( not hasattr ( size , '__call__' ) ) and ( size is not None ) ) : #NEWLINE# #INDENT# size = ScaleConstant ( size ) #NEWLINE# #UNINDENT# if ( ( not hasattr ( colour , '__call__' ) ) and ( colour is not None ) ) : #NEWLINE# #INDENT# colour = ScaleConstant ( colour ) #NEWLINE# #UNINDENT# if ( ( not hasattr ( shape , '__call__' ) ) and ( shape is not None ) ) : #NEWLINE# #INDENT# shape = ScaleConstant ( shape ) #NEWLINE# #UNINDENT# if ( ( not hasattr ( alpha , '__call__' ) ) and ( alpha is not None ) ) : #NEWLINE# #INDENT# alpha = ScaleConstant ( alpha ) #NEWLINE# #UNINDENT# if ( any ( [ isinstance ( size , scale ) for scale in [ ScaleConstant , ScaleSize ] ] ) or ( size is None ) ) : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# raise ValueError ( 'size mapping should be done through ScaleConstant or ScaleSize' ) #NEWLINE# #UNINDENT# if ( any ( [ isinstance ( colour , scale ) for scale in [ ScaleConstant , ScaleGradient , ScaleGradient2 , ScaleRandomColour ] ] ) or ( colour is None ) ) : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# raise ValueError ( 'colour mapping should be done through ScaleConstant, ScaleRandomColour, ScaleGradient or ScaleGradient2' ) #NEWLINE# #UNINDENT# if ( any ( [ isinstance ( shape , scale ) for scale in [ ScaleConstant , ScaleShape ] ] ) or ( shape is None ) ) : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# raise ValueError ( 'shape mapping should be done through ScaleConstant or ScaleShape' ) #NEWLINE# #UNINDENT# if ( any ( [ isinstance ( alpha , scale ) for scale in [ ScaleConstant ] ] ) or ( alpha is None ) ) : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# raise ValueError ( 'alpha mapping should be done through ScaleConstant' ) #NEWLINE# #UNINDENT# return { #NEWLINE# #INDENT# 'x' : x , #NEWLINE# 'y' : y , #NEWLINE# 'size' : size , #NEWLINE# 'colour' : colour , #NEWLINE# 'shape' : shape , #NEWLINE# 'alpha' : alpha , #NEWLINE# #UNINDENT# }