def test_mpl_preserve_width():
 f = create_figure()
 (width, height) = f.canvas.get_width_height()
 s = mplhooks.figure_to_tight_array(f, (0.5 * width), (0.5 * height), True)
 exp = width
 (newwidth, newheight) = f.canvas.get_width_height()
 obs = newwidth
 plt.close(f)
 assert (exp == obs)

def test_mpl_preserve_width ( ) : f = create_figure ( ) ( width , height ) = f . canvas . get_width_height ( ) s = mplhooks . figure_to_tight_array ( f , ( 0.5 * width ) , ( 0.5 * height ) , True ) exp = width ( newwidth , newheight ) = f . canvas . get_width_height ( ) obs = newwidth plt . close ( f ) assert ( exp == obs )
make sure that the figure preserves width settings .