def ggplot2_style(ax):
<EOL>ax.grid(True, '<STR_LIT>', color='<STR_LIT:w>', linestyle='<STR_LIT:->', linewidth=<NUM_LIT>)<EOL>ax.grid(True, '<STR_LIT>', color='<STR_LIT>', linestyle='<STR_LIT:->', linewidth=<NUM_LIT>)<EOL>ax.patch.set_facecolor('<STR_LIT>')<EOL>ax.set_axisbelow(True)<EOL>ax.xaxis.set_minor_locator(MultipleLocator( (plt.xticks()[<NUM_LIT:0>][<NUM_LIT:1>]-plt.xticks()[<NUM_LIT:0>][<NUM_LIT:0>]) / <NUM_LIT> ))<EOL>ax.yaxis.set_minor_locator(MultipleLocator( (plt.yticks()[<NUM_LIT:0>][<NUM_LIT:1>]-plt.yticks()[<NUM_LIT:0>][<NUM_LIT:0>]) / <NUM_LIT> ))<EOL>for child in ax.get_children():<EOL><INDENT>if isinstance(child, mpl.spines.Spine):<EOL><INDENT>child.set_alpha(<NUM_LIT:0>)<EOL><DEDENT><DEDENT>for line in ax.get_xticklines() + ax.get_yticklines():<EOL><INDENT>line.set_markersize(<NUM_LIT:5>)<EOL>line.set_color("<STR_LIT>")<EOL>line.set_markeredgewidth(<NUM_LIT>)<EOL><DEDENT>for line in ax.xaxis.get_ticklines(minor=True) + ax.yaxis.get_ticklines(minor=True):<EOL><INDENT>line.set_markersize(<NUM_LIT:0>)<EOL><DEDENT>mpl.rcParams['<STR_LIT>'] = '<STR_LIT>'<EOL>mpl.rcParams['<STR_LIT>'] = '<STR_LIT>'<EOL>ax.xaxis.set_ticks_position('<STR_LIT>')<EOL>ax.yaxis.set_ticks_position('<STR_LIT:left>')<EOL>if ax.legend_ != None:<EOL><INDENT>lg = ax.legend_<EOL>lg.get_frame().set_linewidth(<NUM_LIT:0>)<EOL>lg.get_frame().set_alpha(<NUM_LIT:0.5>)<EOL><DEDENT>
Styles an axes to appear like ggplot2
Must be called after all plot and axis manipulation operations have been
carried out (needs to know final tick spacing)