@image_comparison(baseline_images=[u'legend_stackplot'], extensions=[u'png'])
def test_legend_stackplot():
 fig = plt.figure()
 ax = fig.add_subplot(111)
 x = np.linspace(0, 10, 10)
 y1 = (1.0 * x)
 y2 = ((2.0 * x) + 1)
 y3 = ((3.0 * x) + 2)
 ax.stackplot(x, y1, y2, y3, labels=[u'y1', u'y2', u'y3'])
 ax.set_xlim((0, 10))
 ax.set_ylim((0, 70))
 ax.legend(loc=0)

@ image_comparison ( baseline_images = [ u'legend_stackplot' ] , extensions = [ u'png' ] ) def test_legend_stackplot ( ) : fig = plt . figure ( ) ax = fig . add_subplot ( 111 ) x = np . linspace ( 0 , 10 , 10 ) y1 = ( 1.0 * x ) y2 = ( ( 2.0 * x ) + 1 ) y3 = ( ( 3.0 * x ) + 2 ) ax . stackplot ( x , y1 , y2 , y3 , labels = [ u'y1' , u'y2' , u'y3' ] ) ax . set_xlim ( ( 0 , 10 ) ) ax . set_ylim ( ( 0 , 70 ) ) ax . legend ( loc = 0 )
test legend for polycollection using stackplot .