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:
- tetra
lapy.TetMesh
Tetraheral mesh to plot.
- vfuncarray_like, Default=None
Scalar function at vertices.
- plot_edges
bool
, Default=False Whether to plot edges or not.
- plot_levels
bool
, Default=False Whether to plot levels or not.
- tfuncarray_like, Default=None
3d vector function of gradient.
- cutting
str
, 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_color
str
, Default=”rgb(50,50,50)” Color of the edge.
- html_output
bool
, Default=False Whether or not to give out as html output.
- width
int
, Default=800 Width of the plot (in px).
- height
int
, Default=800 Height of the plot (in px).
- flatshading
bool
, Default=False Whether normal smoothing is applied to the meshes or not.
- xrange
list
ortuple
of shape (2, 1) Sets the range of the x-axis.
- yrange
list
ortuple
of shape (2, 1) Sets the range of the y-axis.
- zrange
list
ortuple
of shape (2, 1) Sets the range of the z-axis.
- showcaxis
bool
, Default=False Whether a colorbar is displayed or not.
- caxis
list
ortuple
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.
- tetra
- 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:
- tria
lapy.TriaMesh
Triangle mesh to plot.
- vfuncarray_like, Default=None
Scalar function at vertices.
- tfuncarray_like, Default=None
3d vector function of gradient.
- vcolor
list
ofstr
, Default=None Sets the color of each vertex.
- tcolor
list
ofstr
, Default=None Sets the color of each face.
- showcaxis
bool
, Default=False Whether a colorbar is displayed or not.
- caxis
list
ortuple
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.
- xrange
list
ortuple
of shape (2, 1) Sets the range of the x-axis.
- yrange
list
ortuple
of shape (2, 1) Sets the range of the y-axis.
- zrange
list
ortuple
of shape (2, 1) Sets the range of the z-axis.
- plot_edges
bool
, Default=False Whether to plot edges or not.
- plot_levels
bool
, Default=False Whether to plot levels or not.
- edge_color
str
, Default=”rgb(50,50,50)” Color of the edges.
- tic_color
str
, Default=”rgb(50,200,10)” Color of the ticks.
- background_color
str
, Default=None Color of background.
- flatshading
bool
, Default=False Whether normal smoothing is applied to the meshes or not.
- width
int
, Default=800 Width of the plot (in px).
- height
int
, Default=800 Height of the plot (in px).
- camera
dict
ofstr
, Default=None Camera describing center, eye and up direction.
- html_output
bool
, Default=False Whether or not to give out as html output.
- export_png
str
, Default=None Local file path or file object to write the image to.
- scale_png
int
orfloat
Scale factor of image. >1.0 increase resolution; <1.0 decrease resolution.
- no_display
bool
, Default=False Whether to plot on display or not.
- tria