def test_remove_curve_from_mpl_axes(self): ax = self.ax2 line = ax.plot([0], [0])[0] err_cont = ax.errorbar([0], [0], [1]) remove_curve_from_ax(line) self.assertNotIn(line, ax.lines) remove_curve_from_ax(err_cont) self.assertNotIn(err_cont[0], ax.lines) self.assertNotIn(err_cont, ax.containers)
def test_remove_curve_from_mantid_ax_with_workspace_artist(self): mantid_ax = self.ax0 ws_curve = mantid_ax.errorbar(self.ws) remove_curve_from_ax(ws_curve) self.assertNotIn(ws_curve[0], mantid_ax.lines) self.assertNotIn(ws_curve, mantid_ax.containers) tracked_artists = [] for ws_artists_list in mantid_ax.tracked_workspaces.values(): for ws_artists in ws_artists_list: for artist in ws_artists._artists: tracked_artists.append(artist) self.assertNotIn(ws_curve, tracked_artists)
def test_remove_curve_from_mantid_ax_with_non_workspace_artist(self): mantid_ax = self.ax0 curve = mantid_ax.plot([0], [0])[0] remove_curve_from_ax(curve) self.assertNotIn(curve, mantid_ax.lines)