File Exchange

image thumbnail

Evenly Spaced Streamlines

version (351 KB) by Keith Ma
Plot evenly spaced streamlines for a vector field in several styles


Updated 06 Oct 2016

From GitHub

View Version History

View license on GitHub

The purpose of this package is to plot evenly spaced streamlines for a 2D vector field with more flexible style options than the standard function streamslice(). Specifically, this package includes:
+ "Fancy" arrow, taper, and texture styles as described Jobar & Lefer, 1997 [1]
+ Explicit control over both minimum and maximum streamline spacing
+ Better selection of streamline step size for high line densities

See for examples.

[1] Jobard, B., & Lefer, W. (1997). Creating Evenly-Spaced Streamlines of Arbitrary Density. In W. Lefer & M. Grave (Eds.), Visualization in Scientific Computing ?97: Proceedings of the Eurographics Workshop in Boulogne-sur-Mer France, April 28--30, 1997 (pp. 43?55). inbook, Vienna: Springer Vienna.

Cite As

Keith Ma (2021). Evenly Spaced Streamlines (, GitHub. Retrieved .

Comments and Ratings (6)

Lucia carichino

When using even_stream_arrow I get the following error

"Warning: Error updating Patch.

Enforcing Delaunay constraints leads to unstable repeated constraint intersections.
This may be due to near coincident intersecting constraints or near duplicate

Ideas on how to fix it? Does this mean that I should not trust the streamlines?

Tien-Hsia Kuo



Amazing work. Thanks!!

Keith Ma

For the interested, there is an alternative MATLAB implementation of the Jobard & Lefer 1997 algorithm for evenly-spaced streamlines at:

Keith Ma

Thanks David! Your comment made me take a harder look at the standard streamslice() function, and it turns out I was able to make use of parts of it to speed up this package considerably. I also updated the documentation to better address the differences (advantages, I hope) of this package compared with streamslice().

David Szwer

This looks pretty good - I may use it in the future. Is it worth also showing the "default" Matlab streamlines in your examples, to show why this method is better?

MATLAB Release Compatibility
Created with R2016a
Compatible with any release
Platform Compatibility
Windows macOS Linux

Inspired by: arrow

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!