How to plot a 2d streamline in 3d view in matplotlib

Hi,

I need to plot a 2d streamline in 3d view like this. As suggested by the post ,
I need to extract streamlines and arrows from a 2d plot and then transform it to 3d data. How to transform this 2d streamline data to 3d data and plot using mplot3d?

Thanks in advance.

Raj

···

##################################################################
Raj Kumar Manna

Complex Fluid & Biological Physics Lab

IIT Madras

Ph. No. 8144637401

alternate email: raj@…4669…

####################################################################

Well, there is the new 3D quiver feature: http://matplotlib.org/examples/mplot3d/quiver3d_demo.html. Not quite streamlines, but it might do in a pinch.

Another approach:
There is the 2d streamplot() function that returns a specialized object. From the docstring:

    Returns:

        *stream_container* : StreamplotSet
            Container object with attributes

                - lines: `matplotlib.collections.LineCollection` of streamlines

                - arrows: collection of `matplotlib.patches.FancyArrowPatch`
                  objects representing arrows half-way along stream
                  lines.

You might be able to get away with using the “lines” object and feeding it through art3d.line_collection_2d_to_3d(), kind of like how it is done for pathpatch objects here: http://matplotlib.org/examples/mplot3d/pathpatch3d_demo.html. You might also be able to pass the individual objects in the “arrows” list through art3d.patch_2d_to_3d(), but I have no clue if that would actually work or not.

I hope that helps!

Ben Root

···

On Thu, May 21, 2015 at 7:45 AM, Raj Kumar Manna <rajphysics.mon@…287…> wrote:

Hi,

I need to plot a 2d streamline in 3d view like this. As suggested by the post ,
I need to extract streamlines and arrows from a 2d plot and then transform it to 3d data. How to transform this 2d streamline data to 3d data and plot using mplot3d?

Thanks in advance.

Raj

##################################################################
Raj Kumar Manna

Complex Fluid & Biological Physics Lab

IIT Madras

Ph. No. 8144637401

alternate email: raj@…4669…

####################################################################


One dashboard for servers and applications across Physical-Virtual-Cloud

Widest out-of-the-box monitoring support with 50+ applications

Performance metrics, stats and reports that give you Actionable Insights

Deep dive visibility with transaction tracing using APM Insight.

http://ad.doubleclick.net/ddm/clk/290420510;117567292;y


Matplotlib-users mailing list

Matplotlib-users@lists.sourceforge.net

https://lists.sourceforge.net/lists/listinfo/matplotlib-users