def _vertical_x(axis, ticks=None, max_width=<NUM_LIT:5>):
if ticks is None:<EOL><INDENT>ticks = axis.get_xticks()<EOL><DEDENT>if (np.array(ticks) == np.rint(ticks)).all():<EOL><INDENT>ticks = np.rint(ticks).astype(np.int)<EOL><DEDENT>if max([len(str(tick)) for tick in ticks]) > max_width:<EOL><INDENT>axis.set_xticklabels(ticks, rotation='<STR_LIT>')<EOL><DEDENT>
Switch labels to vertical if they are long.