set_plot_props¶
- opstool.vis.pyvista.set_plot_props(**kwargs)[source]¶
Set ploting properties.
- Return type:
None
Parameters¶
- kwargs: optional keyword arguments, including:
- point_sizefloat, optional
Point size of any nodes. Default
5.0
- line_widthfloat, optional
Thickness of line elements. Only valid for wireframe and surface representations. Default
3.0.
- cmapstr, list, optional
Name of the Matplotlib colormap to us when mapping the scalars. See available Matplotlib colormaps. Only applicable for when displaying
scalars. Requires Matplotlib to be installed.colormapis also an accepted alias for this. Ifcolorcetorcmoceanare installed, their colormaps can be specified by name.You can also specify a list of colors to override an existing colormap with a custom one. For example, to create a three color colormap you might specify
['green', 'red', 'blue'].
- cmap_modelstr, list, optional, default=None
Matplotlib colormap used for geometry model visualization. Same as
cmap, except that this parameter will be used for geometry model visualization and will be automatically mapped according to different element types. If None, If None, the color specified in the function``set_plot_colors`` will be used.Available color maps are shown in Colormaps in Matplotlib
- n_colorsint, optional
Number of colors to use when displaying scalars. Default to 256. The scalar bar will also have this many colors.
- themestr, optional,
Theme name. Either ‘default’, ‘document’, ‘dark’, or ‘paraview’. Defaults to “default” theme.
- window_sizelist, optional
Window size in pixels. Defaults to
[1024, 768]
- render_points_as_spheresbool, optional
Render points as spheres.
- render_lines_as_tubesbool, optional
Renders lines as tubes.
- anti_aliasing: str, optional, default=”msaa”
Enable or disable antialiasing. *
"ssaa"- Super-Sample Anti-Aliasing *"msaa"- Multi-Sample Anti-Aliasing *"fxaa"- Fast Approximate Anti-AliasingNote
SSAA, or Super-Sample Anti-Aliasing is a brute force method of antialiasing. It results in the best image quality but comes at a tremendous resource cost. SSAA works by rendering the scene at a higher resolution. The final image is produced by downsampling the massive source image using an averaging filter. This acts as a low pass filter which removes the high frequency components that would cause jaggedness.
MSAA, or Multi-Sample Anti-Aliasing is an optimization of SSAA that reduces the number of pixel shader evaluations that need to be computed by focusing on overlapping regions of the scene. The result is antialiasing along edges that are on par with SSAA and less antialiasing along surfaces as these make up the bulk of SSAA computations. MSAA is substantially less computationally expensive than SSAA and results in comparable image quality.
FXAA, or Fast Approximate Anti-Aliasing is an Anti-Aliasing technique performed entirely in post-processing. FXAA operates on the rasterized image rather than the scene geometry. As a consequence, forcing FXAA or using FXAA incorrectly can result in the FXAA filter smoothing out parts of the visual overlay that are usually kept sharp for reasons of clarity as well as smoothing out textures. FXAA is inferior to MSAA but is almost free computationally and is thus desirable on high-end platforms.
- msaa_multi_samplesint, optional, default=16
The number of multi-samples when
anti_aliasingis"msaa". Note that using this setting automatically enables this for all renderers.
- smooth_shadingbool, optional,
Smoothly render curved surfaces when plotting. Not helpful for all meshes.
- line_smoothingbool, default: True
If
True, enable line smoothing.
- polygon_smoothingbool, default: True
If
True, enable polygon smoothing.
- lightingbool, optional
Enable or disable view direction lighting. Default False.
- notebookbool, optional
When True, the resulting plot is placed inline a jupyter notebook. Assumes a jupyter console is active. Automatically enables off_screen.
- jupyter_backendstr, optional, default: “trame”
Jupyter backend to use when plotting. Must be one of the following:
'static': Display a single static image within the Jupyterlab environment. It Still requires that a virtual framebuffer be set up when displaying on a headless server, but does not require any additional modules to be installed.'client': Export/serialize the scene graph to be rendered with VTK.js client-side throughtrame. Requirestrameandjupyter-server-proxyto be installed.'server': Render remotely and stream the resulting VTK images back to the client usingtrame. This replaces the'ipyvtklink'backend with better performance. Supports the most VTK features, but suffers from minor lag due to remote rendering. Requires that a virtual framebuffer be set up when displaying on a headless server. Must have at leasttrameandjupyter-server-proxyinstalled for cloud/remote Jupyter instances. This mode is also aliased by'trame'.'trame': The full Trame-based backend that combines both'server'and'client'into one backend. This requires a virtual frame buffer.'html': Export/serialize the scene graph to be rendered with the Trame client backend but in a static HTML file.'none': Do not display any plots within jupyterlab, instead display using dedicated VTK render windows. This will generate nothing on headless servers even with a virtual framebuffer.
- font_familystr, optional
Font family. Must be either
'courier','times', orarial.
- scale_factorfloat, optional
Scale factor between the maximum deformation of the model and the maximum boundary size. Default
1 / 20.
- show_mesh_edges: bool, default: True
Whether to display the mesh edges of
planes,plates,shells, andsolidelements.
- mesh_edge_color: str, default: black
Color of the mesh edges for
planes,plates,shells, andsolidelements.
- mesh_edge_width: float, default: 1.0
Width of the mesh edges for
planes,plates,shells, andsolidelements.
- mesh_opacity: float, default: 1.0
Display opacity of
surfaceandsolidelements.
- font_size: int, default: 15
Font size of labels.
- title_font_size: int, default: 18
Font size of title.
- off_screen: bool, optional
Renders off-screen when True. Useful for automated screenshots.
- scalar_bar_kargs: dict
Arguments to pass to Plotter.add_scalar_bar For example,
dict(fmt="%.3e", n_labels=10).
Returns¶
None