@image_comparison(baseline_images=[u'legend_auto2'], remove_text=True)
def test_legend_auto2():
 fig = plt.figure()
 ax = fig.add_subplot(111)
 x = np.arange(100)
 b1 = ax.bar(x, x, color=u'm')
 b2 = ax.bar(x, x[::(-1)], color=u'g')
 ax.legend([b1[0], b2[0]], [u'up', u'down'], loc=0)

@ image_comparison ( baseline_images = [ u'legend_auto2' ] , remove_text = True ) def test_legend_auto2 ( ) : fig = plt . figure ( ) ax = fig . add_subplot ( 111 ) x = np . arange ( 100 ) b1 = ax . bar ( x , x , color = u'm' ) b2 = ax . bar ( x , x [ : : ( - 1 ) ] , color = u'g' ) ax . legend ( [ b1 [ 0 ] , b2 [ 0 ] ] , [ u'up' , u'down' ] , loc = 0 )
test automatic legend placement .