Skip to content

Commit 5c45278

Browse files
committed
Do not call mlab.figure() if mayavi_figure_args=None
On a headless machine (e.g. a CI server), calling mlab.figure() causes mayavi to error. This change allows plot3d() to run with mayavi without calling mlab.figure().
1 parent 4e4857f commit 5c45278

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

xbout/plotting/plotfuncs.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -692,9 +692,8 @@ def plot3d(
692692
)
693693

694694
if mayavi_figure is None:
695-
if mayavi_figure_args is None:
696-
mayavi_figure_args = {}
697-
mlab.figure(**mayavi_figure_args)
695+
if mayavi_figure_args is not None:
696+
mlab.figure(**mayavi_figure_args)
698697
else:
699698
mlab.figure(mayavi_figure)
700699

0 commit comments

Comments
 (0)