lapy.plot

Functions for plotting Tet and Tria Meshes with overlays.

For visualizing results in a juypter notebook use this:

.. code-block:: python

    import plotly
    plotly.offline.init_notebook_mode(connected=True)
    ...
lapy.plot.plot_tet_mesh(tetra, vfunc=None, plot_edges=False, plot_levels=False, tfunc=None, cutting=None, edge_color='rgb(50,50,50)', html_output=False, width=800, height=800, flatshading=False, xrange=None, yrange=None, zrange=None, showcaxis=False, caxis=None)[source]

Plot tetra meshes.

The tetra mesh will be converted to its tria boundary mesh, and only this will be plotted.

Parameters:
tetralapy.TetMesh

Tetraheral mesh to plot.

vfuncarray_like, Default=None

Scalar function at vertices.

plot_edgesbool, Default=False

Whether to plot edges or not.

plot_levelsbool, Default=False

Whether to plot levels or not.

tfuncarray_like, Default=None

3d vector function of gradient.

cuttingstr, Default=None

To view the ‘interior’ of the tetra mesh, one or more cutting criteria can be defined as input arguments to this function: e.g. cutting=(‘x<-10’) or cutting=(‘z>=5’) or cutting=(‘f>4’) where x,y,z represent dimensions 0,1,2 of the vertex array, and f represents the vfunc (which cannot be None if f is used to define a cutting criterion).

edge_colorstr, Default=”rgb(50,50,50)”

Color of the edge.

html_outputbool, Default=False

Whether or not to give out as html output.

widthint, Default=800

Width of the plot (in px).

heightint, Default=800

Height of the plot (in px).

flatshadingbool, Default=False

Whether normal smoothing is applied to the meshes or not.

xrangelist or tuple of shape (2, 1)

Sets the range of the x-axis.

yrangelist or tuple of shape (2, 1)

Sets the range of the y-axis.

zrangelist or tuple of shape (2, 1)

Sets the range of the z-axis.

showcaxisbool, Default=False

Whether a colorbar is displayed or not.

caxislist or tuple of shape (2, 1):

Sets the bound of the color domain. caxis[0] is lower bound caxis[1] upper bound. Elements are int or float.

lapy.plot.plot_tria_mesh(tria, vfunc=None, tfunc=None, vcolor=None, tcolor=None, showcaxis=False, caxis=None, xrange=None, yrange=None, zrange=None, plot_edges=False, plot_levels=False, edge_color='rgb(50,50,50)', tic_color='rgb(50,200,10)', background_color=None, flatshading=False, width=800, height=800, camera=None, html_output=False, export_png=None, scale_png=1.0, no_display=False)[source]

Plot tria mesh.

Parameters:
trialapy.TriaMesh

Triangle mesh to plot.

vfuncarray_like, Default=None

Scalar function at vertices.

tfuncarray_like, Default=None

3d vector function of gradient.

vcolorlist of str, Default=None

Sets the color of each vertex.

tcolorlist of str, Default=None

Sets the color of each face.

showcaxisbool, Default=False

Whether a colorbar is displayed or not.

caxislist or tuple of shape (2, 1):

Sets the bound of the color domain. caxis[0] is lower bound caxis[1] upper bound. Elements are int or float.

xrangelist or tuple of shape (2, 1)

Sets the range of the x-axis.

yrangelist or tuple of shape (2, 1)

Sets the range of the y-axis.

zrangelist or tuple of shape (2, 1)

Sets the range of the z-axis.

plot_edgesbool, Default=False

Whether to plot edges or not.

plot_levelsbool, Default=False

Whether to plot levels or not.

edge_colorstr, Default=”rgb(50,50,50)”

Color of the edges.

tic_colorstr, Default=”rgb(50,200,10)”

Color of the ticks.

background_colorstr, Default=None

Color of background.

flatshadingbool, Default=False

Whether normal smoothing is applied to the meshes or not.

widthint, Default=800

Width of the plot (in px).

heightint, Default=800

Height of the plot (in px).

cameradict of str, Default=None

Camera describing center, eye and up direction.

html_outputbool, Default=False

Whether or not to give out as html output.

export_pngstr, Default=None

Local file path or file object to write the image to.

scale_pngint or float

Scale factor of image. >1.0 increase resolution; <1.0 decrease resolution.

no_displaybool, Default=False

Whether to plot on display or not.