# better plotting of magnetic field lines

4 messages
Open this post in threaded view
|
Report Content as Inappropriate

## better plotting of magnetic field lines

 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[hidden email]       60 Garden Street, MS 83phone: (617) 496-7981       Cambridge, MA 02138-1516cell: (781) 363-0035             USA________________________________________________________ _______________________________________________ Matplotlib-users mailing list [hidden email] https://mail.python.org/mailman/listinfo/matplotlib-users
Open this post in threaded view
|
Report Content as Inappropriate

## Re: better plotting of magnetic field lines

 yt uses an implementation of the line integral convolution recipe from scipy that works very nicely (IMO):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:On Thu, Dec 15, 2016 at 10:38 AM, Slavin, Jonathan 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[hidden email]       60 Garden Street, MS 83phone: (617) 496-7981       Cambridge, MA 02138-1516cell: (781) 363-0035             USA________________________________________________________ _______________________________________________ Matplotlib-users mailing list [hidden email] https://mail.python.org/mailman/listinfo/matplotlib-users _______________________________________________ Matplotlib-users mailing list [hidden email] https://mail.python.org/mailman/listinfo/matplotlib-users
Open this post in threaded view
|
Report Content as Inappropriate

## Re: better plotting of magnetic field lines

 Thanks Nathan.  I'll check it out.JonOn Thu, Dec 15, 2016 at 11:41 AM, Nathan Goldbaum wrote:yt uses an implementation of the line integral convolution recipe from scipy that works very nicely (IMO):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:On Thu, Dec 15, 2016 at 10:38 AM, Slavin, Jonathan 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[hidden email]       60 Garden Street, MS 83phone: (617) 496-7981       Cambridge, MA 02138-1516cell: (781) 363-0035             USA________________________________________________________ _______________________________________________ Matplotlib-users mailing list [hidden email] https://mail.python.org/mailman/listinfo/matplotlib-users -- ________________________________________________________Jonathan D. Slavin                 Harvard-Smithsonian CfA[hidden email]       60 Garden Street, MS 83phone: (617) 496-7981       Cambridge, MA 02138-1516cell: (781) 363-0035             USA________________________________________________________ _______________________________________________ Matplotlib-users mailing list [hidden email] https://mail.python.org/mailman/listinfo/matplotlib-users