tyssue.draw package¶
Submodules¶
tyssue.draw.ipv_draw module¶
3D visualisation inside the notebook.
-
tyssue.draw.ipv_draw.
edge_mesh
(sheet, coords, **edge_specs)[source]¶ Creates a ipyvolume Mesh of the edge lines to be displayed in Jupyter Notebooks
- Returns
mesh
- Return type
a
ipyvolume.widgets.Mesh
mesh widget
-
tyssue.draw.ipv_draw.
face_mesh
(sheet, coords, **face_draw_specs)[source]¶ Creates a ipyvolume Mesh of the face polygons
tyssue.draw.plt_draw module¶
Matplotlib based plotting
-
tyssue.draw.plt_draw.
create_gif
(history, output, num_frames=60, draw_func=None, margin=5, **draw_kwds)[source]¶ Creates an animated gif of the recorded history.
You need imagemagick on your system for this function to work.
- Parameters
history (a
tyssue.History
object) –output (path to the output gif file) –
num_frames (int, the number of frames in the gif) –
draw_func (a drawing function) – this function must take a sheet object as first argument and return a fig, ax pair. Defaults to quick_edge_draw (aka sheet_view with quick mode)
margin (int, the graph margins in percents, default 5) – if margin is -1, let the draw function decide
are passed to the drawing function (**draw_kwds) –
-
tyssue.draw.plt_draw.
draw_face
(sheet, coords, ax, **draw_spec_kw)[source]¶ Draws epithelial sheet polygonal faces in matplotlib Keyword values can be specified at the element level as columns of the sheet.face_df
-
tyssue.draw.plt_draw.
draw_vert
(sheet, coords, ax, **draw_spec_kw)[source]¶ Draw junction vertices in matplotlib
-
tyssue.draw.plt_draw.
plot_forces
(sheet, geom, model, coords, scaling, ax=None, approx_grad=None, **draw_specs_kw)[source]¶ Plot the net forces at each vertex, with their amplitudes multiplied by scaling. To be clear, this is the oposite of the gradient - grad E.
-
tyssue.draw.plt_draw.
plot_junction
(eptm, edge_index, coords=['x', 'y'])[source]¶ Plots local graph around a junction, for debugging purposes
-
tyssue.draw.plt_draw.
plot_scaled_energies
(sheet, geom, model, scales, ax=None)[source]¶ Plot scaled energies
- Parameters
sheet (a:class: Sheet object) –
geom (a
Geometry
class) –model (a :class:'Model') –
scales (np.linspace of float) –
- Returns
fig (a :class:matplotlib.figure.Figure instance)
ax (:class:matplotlib.Axes instance, default None)
-
tyssue.draw.plt_draw.
sheet_view
(sheet, coords=['x', 'y'], ax=None, **draw_specs_kw)[source]¶ Base view function, parametrizable through draw_secs
The default sheet_spec specification is:
- {‘edge’: {
‘visible’: True, ‘width’: 0.5, ‘head_width’: 0.2, # arrow head width for the edges ‘length_includes_head’: True, # see matplotlib Arrow artist doc ‘shape’: ‘right’, ‘color’: ‘#2b5d0a’, # can be an array ‘alpha’: 0.8, ‘zorder’: 1, ‘colormap’: ‘viridis’},
- ‘vert’: {
‘visible’: True, ‘s’: 100, ‘color’: ‘#000a4b’, ‘alpha’: 0.3, ‘zorder’: 2},
- ‘face’: {
‘visible’: False, ‘color’: ‘#8aa678’, ‘alpha’: 1.0, ‘zorder’: -1} }
Module contents¶
-
tyssue.draw.
highlight_cells
(eptm, cells, reset_visible=False)[source]¶ Sets a column ‘visible’ to True for all the faces of the cells passed as argument (for a 3D tyssue).
If no such column exists in eptm.face_df, creates it.
-
tyssue.draw.
highlight_faces
(face_df, faces, reset_visible=False)[source]¶ Sets the faces visibility to 1
If reset_visible is True, sets all the other faces to visible = False
-
tyssue.draw.
sheet_view
(sheet, coords=['x', 'y', 'z'], ax=None, mode='2D', **draw_specs_kw)[source]¶ Main plotting function in 2D or 3D.
- Parameters
sheet (
Epithelium
instance) –coords (list of strings,) – the coordinates over which to do the plot
ax (:class:matplotlib.Axes instance, default None) – axis over which to plot the sheet, for quick and
mode (str, {'2D'|'quick'|'3D'|'vispy'}, default '2D') – the type of graph to plot (see bellow)
- Returns
- Return type
fig, {ax|meshes}