Example #1
0
 def test_xlabel(self):
     fig, ax = plt.subplots(1, 1)
     x = np.arange(0, 1, 0.1)
     y = np.sin(x)
     res = plot._plot(x, y, ax, xlabel='Test')
     x_label = res.xaxis.get_label().get_text()
     self.assertEqual('Test', x_label)
Example #2
0
 def test_title(self):
     fig, ax = plt.subplots(1, 1)
     x = np.arange(0, 1, 0.1)
     y = np.sin(x)
     res = plot._plot(x, y, ax, ylabel='Test')
     y_label = res.get_title()
     self.assertEqual('Test', y_label)
Example #3
0
 def test_axes(self):
     fig, ax = plt.subplots(1, 1)
     x = np.arange(0, 1, 0.1)
     y = np.sin(x)
     res = plot._plot(x, y, ax)
     x_plot, y_plot = ax.lines[0].get_xydata().T
     self.assertTrue(np.all(x == x_plot))
     self.assertTrue(np.all(y == y_plot))