dynamo.pl.plot_flow_field(vecfld, x_range, y_range, n_grid=100, start_points=None, integration_direction='both', background=None, density=1, linewidth=1, streamline_color=None, streamline_alpha=0.4, color_start_points=None, save_show_or_return='return', save_kwargs={}, ax=None, **streamline_kwargs)[source]

Plots the flow field with line thickness proportional to speed. code adapted from: http://be150.caltech.edu/2017/handouts/dynamical_systems_approaches.html

  • vecfld (vector_field) – An instance of the vector_field class.

  • x_range (array_like, shape (2,)) – Range of values for x-axis.

  • y_range (array_like, shape (2,)) – Range of values for y-axis.

  • n_grid (int, default 100) – Number of grid points to use in computing derivatives on phase portrait.

  • start_points (np.ndarray (default: None)) – The initial points from which the streamline will be draw.

  • integration_direction ({‘forward’, ‘backward’, ‘both’} (default: both)) – Integrate the streamline in forward, backward or both directions. default is ‘both’.

  • background (str or None (default: None)) – The background color of the plot.

  • density (float (default: 1)) – density of the plt.streamplot function.

  • linewidth (float or None (default: 1)) – multiplier of automatically calculated linewidth passed to the plt.streamplot function.

  • streamline_color (str or None (default: None)) – The color of the vector field stream lines.

  • streamline_alpha (float or None (default: 0.4)) – The alpha value applied to the vector field stream lines.

  • color_start_points (float or None (default: None)) – The color of the starting point that will be used to predict cell fates.

  • save_show_or_return ({‘show’, ‘save’, ‘return’} (default: return)) – Whether to save, show or return the figure.

  • save_kwargs (dict (default: {})) – A dictionary that will passed to the save_fig function. By default it is an empty dictionary and the save_fig function will use the {“path”: None, “prefix”: ‘plot_flow_field’, “dpi”: None, “ext”: ‘pdf’, “transparent”: True, “close”: True, “verbose”: True} as its parameters. Otherwise you can provide a dictionary that properly modify those keys according to your needs.

  • ax (Matplotlib Axis instance) – Axis on which to make the plot


output – Axis with streamplot included.

Return type:

Matplotlib Axis instance