reservoirflow.utils.pyvista.show_model#
- reservoirflow.utils.pyvista.show_model(model, prop: str = 'pressures', label: str = None, boundary: bool = False, wells: bool = True, ruler: bool = False, desc: bool = False, info: bool = True, cbar: bool = True, title: str = None, cmap: str = 'Blues', gamma: float = 0.7, n_colors: int = 10, opacity: float = 0.9, azimuth: float = 45, elevation: float = 40, zoom: float = 1, static: bool = False, notebook: bool = False, window_size: tuple = None, **kwargs)#
Show pyvista plotter
- Parameters:
prop (str, optional) – property to be visualized in [“pressures”, “rates”].
label (str, optional) – label of grid centers as str in [‘id’, ‘coords’, ‘icoords’, ‘dx’, ‘dy’, ‘dz’, ‘Ax’, ‘Ay’, ‘Az’, ‘V’, ‘center’, ‘sphere’]. If None or False, nothing will be added as a label.
boundary (bool, optional) – include boundary cells.
wells (bool, optional) – show wells.
ruler (bool, optional) – show ruler grid lines.
info (bool, optional) – show simulation information.
cbar (bool, optional) – show color bar.
title (str, optional) – title shown at top-center of the Graph. If None, ReservoirFlow is shown.
cmap (str, optional) – color map name based on Matplotlib, see Choosing Colormaps in Matplotlib.
gamma (float, optional) – shift color map distribution to left when values less than 1 and to right when values larger than 1. In case of qualitative colormaps, this argument is ignored.
n_colors (int, optional) – number of colors. In case of qualitative colormaps, n_colors should not exceed the total number of available colors (e.g. 10 for cmap=”tab10” and 20 for cmap=”tab20”).
opacity (float, optional) – adjust transparency between 0 and 1 where 0 is fully transparent and 1 is fully nontransparent.
azimuth (float, optional) – adjust camera azimuth which is a horizontal rotation around the central focal point, see pyvista.Camera.
elevation (float, optional) –
adjust camera elevation which is a vertical rotation around the central focal point, see pyvista.Camera.
zoom (float, optional) – adjust camera zoom which is direct zooming into the central focal point. see pyvista.Camera.zoom.
static (bool, optional) – show as a static image in a jupyter notebook. This argument is ignored when notebook argument is set to False. True value is used to render images for the documentation.
notebook (bool, optional) – show plot is placed inline a jupyter notebook. If False, then an interactive window will be opened outside of jupyter notebook.
window_size (tuple, optional) – pyvista plotter window size in pixels.
**kwargs – you can pass any argument for pyvista Plotter except if it is defined as argument in this function (e.g. window_size), see pyvista.Plotter
- Raises:
ValueError – label is not recognized.
Notes
Key callbacks:
def my_cpos_callback(): pl.add_text(text=str(pl.camera.position), name="cpos") pl.add_key_event("p", my_cpos_callback)