Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 5a084c0

Browse filesBrowse files
committed
fix bug in graphic collection
1 parent d97a99d commit 5a084c0
Copy full SHA for 5a084c0

File tree

Expand file treeCollapse file tree

1 file changed

+3
-3
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+3
-3
lines changed

‎fastplotlib/graphics/_base.py

Copy file name to clipboardExpand all lines: fastplotlib/graphics/_base.py
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ def add_graphic(self, graphic: Graphic, reset_index: True):
315315

316316
def remove_graphic(self, graphic: Graphic, reset_index: True):
317317
"""Remove a graphic from the collection"""
318-
self._graphics.remove(graphic)
318+
self._graphics.remove(graphic.loc)
319319

320320
if reset_index:
321321
self._reset_index()
@@ -341,7 +341,7 @@ def __getitem__(self, key):
341341
if isinstance(key, slice):
342342
key = cleanup_slice(key, upper_bound=len(self))
343343
selection_indices = range(key.start, key.stop, key.step)
344-
selection = self._graphics[key]
344+
selection = self.graphics[key]
345345

346346
# fancy-ish indexing
347347
elif isinstance(key, (tuple, list, np.ndarray)):
@@ -353,7 +353,7 @@ def __getitem__(self, key):
353353
selection = list()
354354

355355
for ix in key:
356-
selection.append(self._graphics[ix])
356+
selection.append(self.graphics[ix])
357357

358358
selection_indices = key
359359
else:

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.