You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
( Note: like `Cube`s + `CubeList`s, these `PolyData` objects are provided with a specific visible within the Jupyter notebooks. This is displayed when you just enter the variable in a cell.
181
191
You can also use "print(x)" to display the standard string representation of the object, but usually the notebook-style output is a bit more useful. )
182
192
183
-
<!-- #region -->
193
+
194
+
---
195
+
### Quick 3d plotting
196
+
197
+
For a really quick, basic plot, you can display a PolyData as a VTK view with PyVista, by simply calling its `.plot` method.
198
+
199
+
**Call the `plot` routine of the PolyData object. An output should appear.**
200
+
201
+
```python
202
+
pv.plot()
203
+
```
204
+
205
+
**NOTES**:
206
+
* this plot is interactive -- try dragging to rotate, and the mouse scroll-wheel to zoom
207
+
* this obviously causes some clutter and uses up some space (e.g. you can't easily scroll past it)
208
+
* To ***remove*** a plot output, use "Clear Output" from the "Edit" menu (or from right-click on the cell)
209
+
* alternatively, set the keyword `jupyter_backend='static'` in the command, for output as a plain image
210
+
211
+
There are a lot more keywords available to [the `PolyData.plot()` method](https://docs.pyvista.org/api/core/_autosummary/pyvista.PolyData.plot.html), but it is not ideal to overcomplicate these calls. :
212
+
Finer control is better achieved in a different ways : See more detail on plotting in [the Plotting section](./Sec_03_Plotting.ipynb).
213
+
214
+
215
+
<!-- #region tags=[] -->
184
216
### Create a plotter, and display 3D visualisation
185
217
186
218
Finally, we will plot the 'PolyData' object via PyVista.
@@ -229,145 +261,19 @@ plotter.show()
229
261
</details>
230
262
<!-- #endregion -->
231
263
232
-
**NOTES**:
233
-
* this operation currently generates a warning message, which however can be ignored
234
-
* when translated to a simple Python file + run, these plots (or at least the folowing one) can cause SegmentationFault
235
-
****TODO: this needs investigating, fix for confidence + useability***
236
-
* it is interactive, so it causes some clutter and uses up some space.
237
-
To remove plot outputs, use "Clear Output" from the "Edit" menu (or from right-click on the cell)
238
-
239
264
```python
240
265
plotter.show()
241
266
```
242
267
243
268
**Some odd notes:**
244
269
* By default, `plotter.show()` opens an interactive window : **you can rotate and zoom it with the mouse**.
245
-
* you can instead generate static output (try `interactive=False`)
270
+
* you can instead generate static output
271
+
* in a notebook, you do this with `jupyter_backend='static'`
272
+
* or in a Python session, try `interactive=False`
246
273
* VTK/PyVista doesn't use plot "types".
247
274
Instead, you add meshes to a plotter + can subsequently control the presentation.
248
275
* GeoVista can also produce more familiar 2D plots (see on ...)
249
276
250
277
251
278
252
279
***TODO:*** can suggest some of these as follow-on exercises
0 commit comments