예제 #1
0
    def _do_plot_spectrum(self, names, errors, overplot):
        """
        Plot spectra from the selected workspaces

        :param names: A list of workspace names
        :param errors: If true then error bars will be plotted on the points
        :param overplot: If true then the add to the current figure if one
                         exists and it is a compatible figure
        """
        if overplot:
            compatible, error_msg = can_overplot()
            if not compatible:
                QMessageBox.warning(self, "", error_msg)
                return

        plot_from_names(names, errors, overplot)
예제 #2
0
    def _do_plot_spectrum(self, names, errors, overplot):
        """
        Plot spectra from the selected workspaces

        :param names: A list of workspace names
        :param errors: If true then error bars will be plotted on the points
        :param overplot: If true then the add to the current figure if one
                         exists and it is a compatible figure
        """
        if overplot:
            compatible, error_msg = can_overplot()
            if not compatible:
                QMessageBox.warning(self, "", error_msg)
                return

        plot_from_names(names, errors, overplot)
예제 #3
0
 def test_can_overplot_returns_false_for_active_patch_plot(self):
     plt.pcolormesh(np.arange(9.).reshape(3, 3))
     allowed, msg = can_overplot()
     self.assertFalse(allowed)
     self.assertTrue(len(msg) > 0)
예제 #4
0
 def test_can_overplot_returns_true_for_active_line_plot(self):
     plt.plot([1, 2])
     self.assertTrue(can_overplot()[0])
예제 #5
0
 def test_can_overplot_returns_false_with_no_active_plots(self):
     self.assertFalse(can_overplot()[0])
예제 #6
0
 def test_can_overplot_returns_false_for_active_patch_plot(self):
     plt.pcolormesh(np.arange(9.).reshape(3,3))
     allowed, msg = can_overplot()
     self.assertFalse(allowed)
     self.assertTrue(len(msg) > 0)
예제 #7
0
 def test_can_overplot_returns_true_for_active_line_plot(self):
     plt.plot([1, 2])
     self.assertTrue(can_overplot()[0])
예제 #8
0
 def test_can_overplot_returns_false_with_no_active_plots(self):
     self.assertFalse(can_overplot()[0])