Exemplo n.º 1
0
 def test_set_figure_size(self):
     """Test setting a valid figure size."""
     fig, ax = plt.subplots()
     _set_axes_options(ax, 'foo', 'x_foo', 'y_foo',
                       x_tick_labels=['foofoofoo', 'barbarbar'],
                       x_tick_labels_orientation='vertical')
     _set_figure_size(fig, 3, 4)
     self.assertTrue(np.array_equal(fig.get_size_inches(), (3, 4)))
Exemplo n.º 2
0
 def test_set_figure_size_invalid(self):
     """Test setting a figure size using invalid dimensions."""
     fig, ax = plt.subplots()
     _set_axes_options(ax, 'foo', 'x_foo', 'y_foo',
                       x_tick_labels=['foofoofoo', 'barbarbar'],
                       x_tick_labels_orientation='vertical')
     orig_fig_size = fig.get_size_inches()
     _set_figure_size(fig, -1, 0)
     self.assertTrue(np.array_equal(fig.get_size_inches(), orig_fig_size))
Exemplo n.º 3
0
 def test_set_figure_size(self):
     """Test setting a valid figure size."""
     fig, ax = plt.subplots()
     _set_axes_options(ax,
                       'foo',
                       'x_foo',
                       'y_foo',
                       x_tick_labels=['foofoofoo', 'barbarbar'],
                       x_tick_labels_orientation='vertical')
     _set_figure_size(fig, 3, 4)
     self.assertTrue(np.array_equal(fig.get_size_inches(), (3, 4)))
Exemplo n.º 4
0
 def test_set_figure_size_invalid(self):
     """Test setting a figure size using invalid dimensions."""
     fig, ax = plt.subplots()
     _set_axes_options(ax,
                       'foo',
                       'x_foo',
                       'y_foo',
                       x_tick_labels=['foofoofoo', 'barbarbar'],
                       x_tick_labels_orientation='vertical')
     orig_fig_size = fig.get_size_inches()
     _set_figure_size(fig, -1, 0)
     self.assertTrue(np.array_equal(fig.get_size_inches(), orig_fig_size))