#NEWLINE# def plot_clustering( X_red , X , labels , title = None ) : #NEWLINE# #INDENT# ( x_min , x_max ) = ( np . min ( X_red , axis = 0 ) , np . max ( X_red , axis = 0 ) ) #NEWLINE# X_red = ( ( X_red - x_min ) / ( x_max - x_min ) ) #NEWLINE# plt . figure ( figsize = ( 6 , 4 ) ) #NEWLINE# for i in range ( X_red . shape [ 0 ] ) : #NEWLINE# #INDENT# plt . text ( X_red [ ( i , 0 ) ] , X_red [ ( i , 1 ) ] , str ( y [ i ] ) , color = plt . cm . spectral ( ( labels [ i ] / 10.0 ) ) , fontdict = { #NEWLINE# #INDENT# 'weight' : 'bold' , #NEWLINE# 'size' : 9 , #NEWLINE# #UNINDENT# } ) #NEWLINE# #UNINDENT# plt . xticks ( [ ] ) #NEWLINE# plt . yticks ( [ ] ) #NEWLINE# if ( title is not None ) : #NEWLINE# #INDENT# plt . title ( title , size = 17 ) #NEWLINE# #UNINDENT# plt . axis ( 'off' ) #NEWLINE# plt . tight_layout ( )