Skip to content

Commit f0b3727

Browse files
authored
feat(plotter): return the plotter instance (#2413)
1 parent 273de89 commit f0b3727

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/ansys/dpf/core/fields_container.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -549,7 +549,7 @@ def plot(self, label_space: dict = None, **kwargs):
549549
fields = self.get_fields(label_space=label_space)
550550
for f in fields:
551551
plt.add_field(field=f, **kwargs)
552-
plt.show_figure(**kwargs)
552+
return plt.show_figure(**kwargs)
553553

554554
def animate(
555555
self,

src/ansys/dpf/core/plotter.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,7 @@ def show_figure(self, **kwargs):
435435

436436
# Show depending on return_cpos option
437437
kwargs_in = _sort_supported_kwargs(bound_method=self._plotter.show, **kwargs)
438-
return self._plotter.show(**kwargs_in)
438+
return self._plotter.show(**kwargs_in), self._plotter
439439

440440
@staticmethod
441441
def _set_scalar_bar_title(kwargs):
@@ -1111,7 +1111,7 @@ def plot_contour(
11111111
kwargs_in = _sort_supported_kwargs(
11121112
bound_method=self._internal_plotter._plotter.show, **kwargs
11131113
)
1114-
return self._internal_plotter._plotter.show(**kwargs_in)
1114+
return self._internal_plotter._plotter.show(**kwargs_in), self._internal_plotter._plotter
11151115

11161116
def _plot_contour_using_vtk_file(self, fields_container, notebook=None):
11171117
"""Plot the contour result on its mesh support.

0 commit comments

Comments
 (0)