transiflow.plot_utils

get_meshgrid(interface, x=None, y=None)

Wrapper around numpy.meshgrid(x, y) that obtains necessary information from the interface.

Parameters:
interfaceInterface

Interface containing the coordinate vectors.

xarray_like, optional

Override the x meshgrid argument.

yarray_like, optional

Override the y meshgrid argument.

Returns:
xarray_like

2D array containing x coordinates.

yarray_like

2D array containing y coordinates.

plot_contour(x, y, value, axis=2, title=None, legend=True, grid=True, show=True, color=True, labels=True, levels=15, inline=False)

Helper for plotting a contour plot.

Parameters:
xarray_like

2D array containing x coordinates.

yarray_like

2D array containing y coordinates.

valuearray_like

2D array of the value to plot.

axisint, optional

Axis to ignore. Used for axis labels.

titlestr, optional

Title of the plot.

legendbool, optional

Whether to add a colorbar.

gridbool, optional

Whether to show the mesh.

showbool, optional

Whether to show the plot. This can be disabled when using savefig() manually.

colorbool, optional

Can be set to False to make plots suitable for black and white printing.

labelsbool, optional

Whether to add labels to the axis.

levelsint, optional

Number of levels used for the contours.

inlinebool, optional

Add inline labels to the contours. Useful for black and white plots.

Returns:
figFigure

Figure object that can be used to make manual modifications to the plot after calling this function.

plot_streamfunction(state, interface, axis=2, title='Stream function', *args, **kwargs)

Create a plot of the stream function.

See plot_contour() and compute_streamfunction() for details.

plot_value(value, interface=None, x=None, y=None, title=None, *args, **kwargs)

Create a plot of the velocity magnitude.

See plot_contour() for details and extra parameters.

Parameters:
valuearray_like

2D array of the value to plot.

interfaceInterface, optional

Interface containing the coordinate vectors.

xarray_like, optional

First coordinate vector.

yarray_like, optional

Second coordinate vector.

plot_velocity_magnitude(state, interface, axis=2, position=None, title='Velocity magnitude', *args, **kwargs)

Create a plot of the velocity magnitude.

See plot_contour() and compute_velocity_magnitude() for details.

plot_vorticity(state, interface, axis=2, title='Vorticity', *args, **kwargs)

Create a plot of the vorticity.

See plot_contour() and compute_vorticity() for details.

\[\]