ó 1&XLc@s4ddlZddlmZmZddljZddlm Z ddl m Z ddl Z ddl Z eddgƒd„ƒZeddd gd d gd d ƒd„ƒZd„Zd„Zeddgƒd„ƒZeddgƒd„ƒZedkr0ddlZejdddgdeƒndS(iÿÿÿÿN(timage_comparisontknownfailureif(t assert_raises(tassert_array_equaltbaseline_imagest image_interpscCsØtjdƒ}|jddƒ}tjƒ}|jdƒ}|j|ddƒ|jdƒ|jdƒ|jdƒ}|j|dd ƒ|jd ƒ|jd ƒ}|j|dd ƒ|jd ƒ|j d ƒd S(s4make the basic nearest, bilinear and bicubic interpsidiii7t interpolationtneareststhree interpolationsi8tbilineari9tbicubicRN( tnptarangetreshapetplttfiguret add_subplottimshowt set_titlet set_ylabeltsavefig(tXtfigtax1tax2tax3((sN/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/tests/test_image.pyttest_image_interps s     s figimage-0s figimage-1t extensionstpngttolgú~j¼t“X?c Cs©x¢ttfD]”}tjddddƒ}||_tjtjdƒdtjdƒdƒ\}}tj|d|d||ƒ}tjd|dd|dƒ}||d}|j |d d d d d d ƒ|j |ddd…dd…fd d d dd d ƒ|j |dd…ddd…fd dd d d d ƒ|j |ddd…ddd…fd dd dd d ƒ|j dt |ƒddƒq WdS(stest the figimage methodtfigsizeitdpiidgY@ii2itxoityotorigintlowerNiÿÿÿÿs figimage-%d(ii( tFalsetTrueR RtsuppressCompositeR tix_R tsintfigimageRtint(R%Rtxtytztctimg((sN/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/tests/test_image.pyt test_figimage!s 2##88;cCshtjƒ}|jdƒ}|jdddgƒtjƒ}|j|ƒ|jdƒtj|ƒdS(Nioiiii( R RRtplott cStringIOtStringIORtseektimread(Rtaxtbuffer((sN/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/tests/test_image.pyttest_image_python_io4s    cCs¼ddlm}|jdƒ|jddƒ}tjƒ}tj||ddƒtjƒ}tj||ddƒ|jdƒtj |ƒ}|jdƒtj |ƒ}t ||ƒdS( Niÿÿÿÿ(trandomiii€Ridi( tnumpyR8tseedtrandR1R2R timsaveR3R4R(R8tdatat buff_dpi1t buff_dpi100tarr_dpi1t arr_dpi100((sN/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/tests/test_image.pyt test_imsaveFs     t image_clipcCs…ddlm}tjƒ}|jdddƒ}ddgdd gg}|j|d | || d|dfƒ}|jd ƒdS( Niÿÿÿÿ(tpiiot projectionthammeriiiitextentRC(tmathRDR RRRR(RDRR5tdtim((sN/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/tests/test_image.pyttest_image_clipcs  +Rc Cs˜ddl}ddlj}|jƒ}|jdƒjd ƒ}|jdƒ}|j|ddddƒ|jd d ƒ|j d d ƒ|j d ƒdS(Niÿÿÿÿidi ioRRRGiiiiR(i i (iiii( R9tmatplotlib.pyplottpyplotRR R RRtset_xlimtset_ylimR(R R RtarrR5((sN/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/tests/test_image.pyt test_imshowps  t__main__targvs-ss--with-doctesttexit(R9R tmatplotlib.testing.decoratorsRRRLRMR t nose.toolsRt numpy.testingRR1tosRR/R7RBRKRQt__name__tnoset runmoduleR#(((sN/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/tests/test_image.pyts   -