From bc557b732f6ca3bbb4f4f33a5f082798f203a2c7 Mon Sep 17 00:00:00 2001 From: PProfizi Date: Wed, 30 Apr 2025 13:56:36 +0200 Subject: [PATCH 1/2] Propagate kwargs --- src/ansys/dpf/core/geometry.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ansys/dpf/core/geometry.py b/src/ansys/dpf/core/geometry.py index a2a328a818..0dfd662bee 100644 --- a/src/ansys/dpf/core/geometry.py +++ b/src/ansys/dpf/core/geometry.py @@ -115,7 +115,7 @@ def plot(self, mesh=None, **kwargs): """Visualize Points object. If provided, ``mesh`` will be also plotted.""" cpos = kwargs.pop("cpos", None) pl = DpfPlotter(**kwargs) - pl.add_points(self._coordinates.data, render_points_as_spheres=True, point_size=10) + pl.add_points(self._coordinates.data, render_points_as_spheres=True, **kwargs) if mesh: pl.add_mesh(mesh, style="surface", show_edges=True, color="w", opacity=0.3) pl.show_figure(show_axes=True, cpos=cpos) @@ -246,7 +246,7 @@ def plot(self, mesh=None, **kwargs): # Plot line object pl = DpfPlotter(**kwargs) - pl.add_line(self._coordinates.data, width=5) + pl.add_line(self._coordinates.data, **kwargs) if mesh: pl.add_mesh(mesh, style="surface", show_edges=True, color="w", opacity=0.3) pl.show_figure(show_axes=True, cpos=cpos) @@ -448,7 +448,7 @@ def plot(self, mesh=None, **kwargs): # Plot plane object pl = DpfPlotter(**kwargs) - pl.add_plane(self) + pl.add_plane(self, **kwargs) if mesh: pl.add_mesh(mesh, style="surface", show_edges=True, color="w", opacity=0.3) pl.show_figure(show_axes=True, cpos=cpos) From db730cd216b2fdc4ccde4eb515e8ebfb418ac303 Mon Sep 17 00:00:00 2001 From: PProfizi Date: Wed, 30 Apr 2025 13:56:53 +0200 Subject: [PATCH 2/2] Improve example readability --- examples/06-plotting/07-plot_on_geometries.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/06-plotting/07-plot_on_geometries.py b/examples/06-plotting/07-plot_on_geometries.py index 300d4022af..0a934e8e8d 100644 --- a/examples/06-plotting/07-plot_on_geometries.py +++ b/examples/06-plotting/07-plot_on_geometries.py @@ -81,7 +81,7 @@ ############################################################################### # Show points together with the mesh -points.plot(mesh, cpos=cpos) +points.plot(mesh, cpos=cpos, point_size=15, color="blue") ############################################################################### # Create line passing through the geometry's diagonal: @@ -89,7 +89,7 @@ ############################################################################### # Show line with the 3D mesh -line.plot(mesh, cpos=cpos) +line.plot(mesh, cpos=cpos, color="black") ############################################################################### # Create vertical plane passing through the mid point: @@ -104,7 +104,7 @@ ############################################################################### # Show plane with the 3D mesh -plane.plot(mesh, cpos=cpos) +plane.plot(mesh, cpos=cpos, color="red") ############################################################################### # Map displacement field to geometry objects