8000 fix to stop weird stuff happening under Jupyter for similarly named f… · Mordween/robotics-toolbox-python@a0eaed6 · GitHub
[go: up one dir, main page]

Skip to content

Commit a0eaed6

Browse files
committed
fix to stop weird stuff happening under Jupyter for similarly named figures
1 parent 6b6136e commit a0eaed6

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

roboticstoolbox/backends/PyPlot/PyPlot2.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,9 @@ def launch(self, name=None, limits=None, **kwargs):
6868

6969
labels = ["X", "Y"]
7070

71-
if name is not None:
72-
self.fig = plt.figure(name)
71+
if name is not None and not _isnotebook():
72+
# jupyter does weird stuff when figures have the same name
73+
self.fig = plt.figure()
7374
else:
7475
self.fig = plt.figure()
7576

0 commit comments

Comments
 (0)
0