Skip to content

Commit 2a900d0

Browse files
Wasteful, but this updates the full figure when adding face detection with simple code.
1 parent 5f5afc0 commit 2a900d0

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

stage5.2_fuller_application/pycasa/ui/image_file_view.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,10 @@ def _detect_button_fired(self):
4242

4343
@observe("model.faces")
4444
def update_mpl_figure_with_faces(self, events):
45-
axes = self.figure.get_axes()[0]
45+
figure = Figure()
46+
axes = figure.add_subplot(111)
47+
axes.imshow(self.model.to_array())
48+
4649
for face in self.model.faces:
4750
axes.add_patch(
4851
patches.Rectangle(
@@ -54,3 +57,4 @@ def update_mpl_figure_with_faces(self, events):
5457
linewidth=2
5558
)
5659
)
60+
self.figure = figure

0 commit comments

Comments
 (0)