matplotlib
provides contour
and tricontour
functions for drawing contours for scalar data respectively on regular grids and on triangulations. It also provides the streamplot
function for drawing streamlines for vector data on regular grids but it does not seem to provide an equivalent for data on triangulations while this is a common case for instance in FEM simulations. Is there a way to plot streamlines for vector data on triangulations without going through grid interpolation (as tricontour
does relatively to contour
), which would introduce unnecessary approximations and masks for dealing with irregular boundaries?
I was not able so far to find such a functionality, even outside of matplotlib
.
The interpolation for the streamlines has to happen somewhere. It is easy to extrapolate where a particle in motion would end up in a regular grid, but for a triangulated mesh, extrapolating the motion to identify which triangle contains the extrapolated particle is expensive.
Maybe Streamlines on a triangulation with matplotlib would help?