File tree Expand file tree Collapse file tree
baseline_images/test_image Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ import numpy as np
2+
3+ from matplotlib .testing .decorators import image_comparison , knownfailureif
4+ import matplotlib .pyplot as plt
5+ from nose .tools import assert_raises
6+
7+ @image_comparison (baseline_images = ['image_interps' ])
8+ def test_image_interps ():
9+ 'make the basic nearest, bilinear and bicubic interps'
10+ X = np .arange (100 )
11+ X = X .reshape (5 , 20 )
12+
13+ fig = plt .figure ()
14+ ax1 = fig .add_subplot (311 )
15+ ax1 .imshow (X , interpolation = 'nearest' )
16+ ax1 .set_title ('three interpolations' )
17+ ax1 .set_ylabel ('nearest' )
18+
19+ ax2 = fig .add_subplot (312 )
20+ ax2 .imshow (X , interpolation = 'bilinear' )
21+ ax2 .set_ylabel ('bilinear' )
22+
23+ ax3 = fig .add_subplot (313 )
24+ ax3 .imshow (X , interpolation = 'bicubic' )
25+ ax3 .set_ylabel ('bicubic' )
26+
27+ fig .savefig ('image_interps' )
28+
29+ if __name__ == '__main__' :
30+ import nose
31+ nose .runmodule (argv = ['-s' ,'--with-doctest' ], exit = False )
You can’t perform that action at this time.
0 commit comments