예제 #1
0
파일: test_display.py 프로젝트: nkeim/pims
    def test_plot_tight(self):
        fig = self.figures[0]
        fig.set_tight_layout(False)  # default to standard
        assert_equal(plot_to_frame(fig).shape[:2], (384, 512))
        assert_less(plot_to_frame(fig, bbox_inches='tight').shape[:2], (384, 512))
        assert_equal(plot_to_frame(fig).shape[:2], (384, 512))

        fig.set_tight_layout(True)  # default to tight
        assert_less(plot_to_frame(fig).shape[:2], (384, 512))
        assert_equal(plot_to_frame(fig, bbox_inches='standard').shape[:2],
                     (384, 512))
        assert_less(plot_to_frame(fig).shape[:2], (384, 512))
예제 #2
0
    def test_plot_tight(self):
        fig = self.figures[0]
        fig.set_tight_layout(False)  # default to standard
        assert_equal(plot_to_frame(fig).shape[:2], (384, 512))
        assert_less(
            plot_to_frame(fig, bbox_inches='tight').shape[:2], (384, 512))
        assert_equal(plot_to_frame(fig).shape[:2], (384, 512))

        fig.set_tight_layout(True)  # default to tight
        assert_less(plot_to_frame(fig).shape[:2], (384, 512))
        assert_equal(
            plot_to_frame(fig, bbox_inches='standard').shape[:2], (384, 512))
        assert_less(plot_to_frame(fig).shape[:2], (384, 512))
예제 #3
0
 def test_plot_resize(self):
     frame = plot_to_frame(self.figures[0], fig_size_inches=(4, 4))
     assert_equal(frame.shape, (512, 512, 4))
예제 #4
0
 def test_plot_tight(self):
     frame = plot_to_frame(self.figures[0], bbox_inches='tight')
     assert_equal(frame.shape, (384, 512, 4))
예제 #5
0
 def test_plot_width(self):
     width = np.random.randint(100, 1000)
     frame = plot_to_frame(self.figures[0], width)
     assert_equal(frame.shape[1], width)
예제 #6
0
 def test_plot_to_frame(self):
     frame = plot_to_frame(self.figures[0])
     assert_equal(frame.shape, (384, 512, 4))
예제 #7
0
파일: test_display.py 프로젝트: nkeim/pims
 def test_plot_resize(self):
     frame = plot_to_frame(self.figures[0], fig_size_inches=(4, 4))
     assert_equal(frame.shape, (512, 512, 4))
예제 #8
0
파일: test_display.py 프로젝트: nkeim/pims
 def test_plot_width(self):
     width = np.random.randint(100, 1000)
     frame = plot_to_frame(self.figures[0], width)
     assert_equal(frame.shape[1], width)
예제 #9
0
파일: test_display.py 프로젝트: nkeim/pims
 def test_plot_to_frame(self):
     frame = plot_to_frame(self.figures[0])
     assert_equal(frame.shape, (384, 512, 4))
예제 #10
0
 def test_ax_to_frame(self):
     frame = plot_to_frame(self.axes[0])
     self.assertEqual(frame.shape, (384, 512, 4))
예제 #11
0
 def test_plot_tight(self):
     frame = plot_to_frame(self.figures[0], bbox_inches='tight')
     assert_equal(frame.shape, (384, 512, 4))