Пример #1
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))
Пример #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
 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
 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
 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))