def test_1d_x_axes_label_bin_plot(self): fig, ax = plt.subplots() funcs.plot(ax, self.ws2d_histo_non_dist, 'rs', specNum=1, axis=MantidAxType.BIN) self.assertEqual(ax.get_xlabel(), "Spectrum")
def test_1d_y_axes_label_auto_distribution_off(self): try: config['graph1d.autodistribution'] = 'Off' fig, ax = plt.subplots() funcs.plot(ax, self.ws2d_histo_non_dist, 'rs', specNum=1) self.assertEqual(ax.get_ylabel(), "Counts") finally: config['graph1d.autodistribution'] = 'On'
def test_1d_bin_numeric_axis(self): fig, ax = plt.subplots() x_axis = mantid.api.NumericAxis.create(2) x_axis.setValue(0, 3.) x_axis.setValue(1, 5.) ws_local = CloneWorkspace(self.ws2d_histo, StoreInADS=False) ws_local.replaceAxis(1, x_axis) funcs.plot(ax, ws_local, 'rs', specNum=1, axis=MantidAxType.BIN)
def test_1d_x_axes_label_spectrum_plot(self): fig, ax = plt.subplots() funcs.plot(ax, self.ws2d_histo_non_dist, 'rs', specNum=1, axis=MantidAxType.SPECTRUM) self.assertEqual(ax.get_xlabel(), "Wavelength ($\\AA$)")
def test_1d_x_axes_label_numeric_axis_bin_plot(self): fig, ax = plt.subplots() x_axis = mantid.api.NumericAxis.create(2) x_axis.setValue(0, 3.) x_axis.setValue(1, 5.) ws_local = CloneWorkspace(self.ws2d_histo_non_dist, StoreInADS=False) ws_local.replaceAxis(1, x_axis) funcs.plot(ax, ws_local, 'rs', specNum=1, axis=MantidAxType.BIN) self.assertEqual(ax.get_xlabel(), "")
def test_1d_slicepoint(self): fig, ax = plt.subplots() funcs.plot(ax, self.ws_MD_2d, slicepoint=(None, 0, 0)) funcs.plot(ax, self.ws_MD_2d, slicepoint=(0, None, 0)) funcs.plot(ax, self.ws_MD_2d, slicepoint=(0, 0, None)) self.assertRaises(AssertionError, funcs.plot, ax, self.ws_MD_2d, slicepoint=(0, None, None)) self.assertRaises(AssertionError, funcs.plot, ax, self.ws_MD_2d)
def test_1d_indices(self): fig, ax = plt.subplots() funcs.plot(ax, self.ws_MD_2d, indices=(slice(None), 0, 0)) funcs.plot(ax, self.ws_MD_2d, indices=(0, slice(None), 0)) funcs.plot(ax, self.ws_MD_2d, indices=(0, 0, slice(None))) self.assertRaises(AssertionError, funcs.plot, ax, self.ws_MD_2d, indices=(0, slice(None), slice(None))) self.assertRaises(AssertionError, funcs.plot, ax, self.ws_MD_2d)
def test_1d_y_axes_label_distribution_workspace_auto_distribution_on(self): fig, ax = plt.subplots() funcs.plot(ax, self.ws2d_histo, 'rs', specNum=1) self.assertEqual(ax.get_ylabel(), "Counts ($\\AA$)$^{-1}$")
def test_1d_log(self): fig, ax = plt.subplots() funcs.plot(ax, self.ws2d_histo, LogName='my_log') ax1 = ax.twiny() funcs.plot(ax1, self.ws2d_histo, LogName='my_log', FullTime=True)
def test_1d_bin(self): fig, ax = plt.subplots() funcs.plot(ax, self.ws2d_histo, 'rs', specNum=1, axis=MantidAxType.BIN)
def test_1d_plots(self): fig, ax = plt.subplots() funcs.plot(ax, self.ws2d_histo, 'rs', specNum=1) funcs.plot(ax, self.ws2d_histo, specNum=2, linewidth=6) funcs.plot(ax, self.ws_MD_1d, 'bo')