From 62bbbd140ac5a9e84d973723f3ce382dfb3ca50e Mon Sep 17 00:00:00 2001 From: "paul.profizi" Date: Mon, 30 May 2022 18:24:47 +0200 Subject: [PATCH] Returning the results of show_figure when using plot functions from Field, Model, MeshedRegion or MeshesContainer --- ansys/dpf/core/field.py | 2 +- ansys/dpf/core/meshes_container.py | 2 +- ansys/dpf/core/model.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ansys/dpf/core/field.py b/ansys/dpf/core/field.py index a11938b1436..b468e9c393b 100644 --- a/ansys/dpf/core/field.py +++ b/ansys/dpf/core/field.py @@ -271,7 +271,7 @@ def plot(self, notebook=None, shell_layers=None, **kwargs): arguments, see ``help(pyvista.plot)``. """ pl = Plotter(self.meshed_region, **kwargs) - pl.plot_contour(self, notebook, shell_layers, **kwargs) + return pl.plot_contour(self, notebook, shell_layers, **kwargs) def resize(self, nentities, datasize): """Allocate memory. diff --git a/ansys/dpf/core/meshes_container.py b/ansys/dpf/core/meshes_container.py index 2fd30a3a40d..8de73d1ad8d 100644 --- a/ansys/dpf/core/meshes_container.py +++ b/ansys/dpf/core/meshes_container.py @@ -93,7 +93,7 @@ def plot(self, fields_container=None, **kwargs): kwargs["color"] = [random(), random(), random()] pl.add_mesh(mesh, **kwargs) # Plot the figure - pl.show_figure(**kwargs) + return pl.show_figure(**kwargs) def get_meshes(self, label_space): """Retrieve the meshes at a label space. diff --git a/ansys/dpf/core/model.py b/ansys/dpf/core/model.py index 2987f84cee9..44c8c58835e 100644 --- a/ansys/dpf/core/model.py +++ b/ansys/dpf/core/model.py @@ -240,7 +240,7 @@ def plot(self, color="w", show_edges=True, **kwargs): kwargs["show_edges"] = show_edges pl = DpfPlotter(**kwargs) pl.add_mesh(self.metadata.meshed_region, **kwargs) - pl.show_figure(**kwargs) + return pl.show_figure(**kwargs) @property def mesh_by_default(self):