#NEWLINE# def _set_ticks_labels( ax , data , labels , positions , plot_opts ) : #NEWLINE# #INDENT# 'Set ticks and labels on horizontal axis.' #NEWLINE# ax . set_xlim ( [ ( np . min ( positions ) - 0.5 ) , ( np . max ( positions ) + 0.5 ) ] ) #NEWLINE# ax . set_xticks ( positions ) #NEWLINE# label_fontsize = plot_opts . get ( 'label_fontsize' ) #NEWLINE# label_rotation = plot_opts . get ( 'label_rotation' ) #NEWLINE# if ( label_fontsize or label_rotation ) : #NEWLINE# #INDENT# from matplotlib.artist import setp #NEWLINE# #UNINDENT# if ( labels is not None ) : #NEWLINE# #INDENT# if ( not ( len ( labels ) == len ( data ) ) ) : #NEWLINE# #INDENT# msg = 'Length of `labels` should equal length of `data`.' #NEWLINE# raise ValueError ( msg ) #NEWLINE# #UNINDENT# xticknames = ax . set_xticklabels ( labels ) #NEWLINE# if label_fontsize : #NEWLINE# #INDENT# setp ( labels , fontsize = label_fontsize ) #NEWLINE# #UNINDENT# if label_rotation : #NEWLINE# #INDENT# setp ( xticknames , rotation = label_rotation ) #NEWLINE# #UNINDENT# #UNINDENT# return