File Exchange

image thumbnail

Evenly Spaced Streamlines

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

11 Downloads

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 https://keithfma.github.io/evenly_spaced_streamlines/ 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. http://doi.org/10.1007/978-3-7091-6876-9_5

Cite As

Keith Ma (2021). Evenly Spaced Streamlines (https://github.com/keithfma/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
points."

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

Tien-Hsia Kuo

Brilliant!

iamsun0720

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: https://www.mathworks.com/matlabcentral/fileexchange/54758-estream2

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
Acknowledgements

Inspired by: arrow

Community Treasure Hunt

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

Start Hunting!