-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
[ENH]: A function for computing and displaying 3D streamline? #26539
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Definitely useful! I think we would need us to think about how best to tie this in with the 2D implementation in https://github.com/matplotlib/matplotlib/blob/main/lib/matplotlib/streamplot.py I'm a little uncomfortable with how we are currently abstracting away all the streamline calculations - there's a lot of nuance about integrator settings that we are brushing under the rug. For example I think using only a 2nd order runge-kutta method right now for integration is a bit of a questionable choice, as is using a linear interpolator, and boundary conditions aren't configurable at all. But the very nature & sparsity of a streamline plot does suggest that it's just an approximate visualization, so maybe this is fine. Shouldn't preclude adding in a basic implementation in any case. |
I would start with an external package for this, and then we can see if we can work it in. In particular I would be much more concerned about speed and how to make it look reasonable than accuracy. |
@jklymak do you know of an external package for this? I did a quick search but couldn’t find anything. If I recall correctly how it worked with the contour package we pull in, that it started in matplotlib and split off after it got to a point of high enough maturity. |
I meant I would suggest writing an external package. contouring was split off because it is a more general problem than just Matplotlib, and now other libraries can use it. If we were doing it again, I suspect we would have started out that way. Similarly here - calculating streamlines is complex, and somewhat dependent on the underlying physics, so developing the code outside of Matplotlib may make sense, and then we could make it a dependency eventually if there is a simple API that can be used. |
Seconding this - I would love a 3D streamplot feature for Matplotlib. Is there any work being done in this direction? |
I need a function to draw ternary streamplot. I know a package python-ternary can draw ternary diagrams, but it can't draw stream plot. Can anyone help me? |
Some updates to the 2D implementation: #29333 |
Uh oh!
There was an error while loading. Please reload this page.
Problem
Worth adding a function for computing and displaying 3D stream plots?
A 3D version of the streamline plot function
pyplot.streamplot
would display the streamlines in 3D vector fields. This is doable in Matplotlib by computing everything beforehand and displaying the results in 3D, but it would be a lot simpler if Matplotlib had a function that does everything. This function would be especially useful for displaying magnetic field streamlines in 3D.Similar functions in Mayavi , Magpylib via Pyvista, and Mathematica.
Proposed solution
No response
The text was updated successfully, but these errors were encountered: