Skip to content

Commit eb99755

Browse files
authored
feat(geometry): propagate kwargs in geometry plot methods (#2251)
* Propagate kwargs * Improve example readability
1 parent 6e23760 commit eb99755

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

examples/06-plotting/07-plot_on_geometries.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,15 +81,15 @@
8181

8282
###############################################################################
8383
# Show points together with the mesh
84-
points.plot(mesh, cpos=cpos)
84+
points.plot(mesh, cpos=cpos, point_size=15, color="blue")
8585

8686
###############################################################################
8787
# Create line passing through the geometry's diagonal:
8888
line = Line([[0.03, 0.03, 0.05], [0.0, 0.06, 0.0]], n_points=50)
8989

9090
###############################################################################
9191
# Show line with the 3D mesh
92-
line.plot(mesh, cpos=cpos)
92+
line.plot(mesh, cpos=cpos, color="black")
9393

9494
###############################################################################
9595
# Create vertical plane passing through the mid point:
@@ -104,7 +104,7 @@
104104

105105
###############################################################################
106106
# Show plane with the 3D mesh
107-
plane.plot(mesh, cpos=cpos)
107+
plane.plot(mesh, cpos=cpos, color="red")
108108

109109
###############################################################################
110110
# Map displacement field to geometry objects

src/ansys/dpf/core/geometry.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ def plot(self, mesh=None, **kwargs):
115115
"""Visualize Points object. If provided, ``mesh`` will be also plotted."""
116116
cpos = kwargs.pop("cpos", None)
117117
pl = DpfPlotter(**kwargs)
118-
pl.add_points(self._coordinates.data, render_points_as_spheres=True, point_size=10)
118+
pl.add_points(self._coordinates.data, render_points_as_spheres=True, **kwargs)
119119
if mesh:
120120
pl.add_mesh(mesh, style="surface", show_edges=True, color="w", opacity=0.3)
121121
pl.show_figure(show_axes=True, cpos=cpos)
@@ -246,7 +246,7 @@ def plot(self, mesh=None, **kwargs):
246246

247247
# Plot line object
248248
pl = DpfPlotter(**kwargs)
249-
pl.add_line(self._coordinates.data, width=5)
249+
pl.add_line(self._coordinates.data, **kwargs)
250250
if mesh:
251251
pl.add_mesh(mesh, style="surface", show_edges=True, color="w", opacity=0.3)
252252
pl.show_figure(show_axes=True, cpos=cpos)
@@ -448,7 +448,7 @@ def plot(self, mesh=None, **kwargs):
448448

449449
# Plot plane object
450450
pl = DpfPlotter(**kwargs)
451-
pl.add_plane(self)
451+
pl.add_plane(self, **kwargs)
452452
if mesh:
453453
pl.add_mesh(mesh, style="surface", show_edges=True, color="w", opacity=0.3)
454454
pl.show_figure(show_axes=True, cpos=cpos)

0 commit comments

Comments
 (0)