[Matplotlib-users] better plotting of magnetic field lines

Nathan Goldbaum nathan12343 at gmail.com
Thu Dec 15 11:41:51 EST 2016


yt uses an implementation of the line integral convolution recipe from
scipy that works very nicely (IMO):

http://yt-project.org/docs/dev/visualizing/callbacks.html#overplot-line-integral-convolution

I don't think there's an easy way to do this with pure matplotlib right
now, but you can take a look at yt's implementation if you're curious:

https://bitbucket.org/yt_analysis/yt/src/011cd19563215cefb3facfd5d6f575b6b38de0db/yt/visualization/plot_modifications.py?at=yt&fileviewer=file-view-default#plot_modifications.py-2347

https://bitbucket.org/yt_analysis/yt/src/011cd19563215cefb3facfd5d6f575b6b38de0db/yt/utilities/lib/line_integral_convolution.pyx?at=yt&fileviewer=file-view-default

On Thu, Dec 15, 2016 at 10:38 AM, Slavin, Jonathan <jslavin at cfa.harvard.edu>
wrote:

> Hi all,
>
> I would like to plot the magnetic field lines for a simulation and am
> finding that streamplot is in adequate in a few ways.  First, it breaks
> lines when they get too close together.  I think this can be configured
> with the density parameter.  More fundamentally, one usually wants the
> density of field lines to indicate the strength of the magnetic field.  So
> a clever selection of start_points could in principle accomplish this, I
> think.  That may be the way I go, but I wonder if someone hasn't already
> come up with a solution for this.  If so, I'd love to hear about it.
>
> Regards,
> Jon
>
> --
> ________________________________________________________
> Jonathan D. Slavin                 Harvard-Smithsonian CfA
> jslavin at cfa.harvard.edu       60 Garden Street, MS 83
> phone: (617) 496-7981       Cambridge, MA 02138-1516
> cell: (781) 363-0035             USA
> ________________________________________________________
>
>
> _______________________________________________
> Matplotlib-users mailing list
> Matplotlib-users at python.org
> https://mail.python.org/mailman/listinfo/matplotlib-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/matplotlib-users/attachments/20161215/87145f37/attachment.html>


More information about the Matplotlib-users mailing list