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
________________________________________________________
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/matplotlib-users/attachments/20161215/ec94f647/attachment.html>
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 Matplotlib-users Info Page
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 Matplotlib-users Info Page
--
________________________________________________________
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
________________________________________________________
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/matplotlib-users/attachments/20161215/97456976/attachment.html>
That's interesting but not quite what I had in mind. See the attached
figure to see what I'm looking for. I created that by using uniformly
spaced start_points along the upper boundary of the plot. The only problem
then is that I need to use the negative of Bx and By to get the field lines
to get propagated in the correct directions. And then the arrows are in
the wrong direction.
One thought I had was to do this, get the output streamlines and then use
the end points of those streamlines for start points. However it's not
clear to me how to get those end points from the LineCollection that is
part of the StreamplotSet container that's returned by streamplot. I can
get segments from the LineCollection, but I don't know how to get the line
endpoint out of those. Do you know how to do that?
Jon
···
On Thu, Dec 15, 2016 at 12:00 PM, Slavin, Jonathan <jslavin at cfa.harvard.edu> wrote:
Thanks Nathan. I'll check it out.
Jon
On Thu, Dec 15, 2016 at 11:41 AM, Nathan Goldbaum <nathan12343 at gmail.com> > wrote:
yt uses an implementation of the line integral convolution recipe from
scipy that works very nicely (IMO):
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 Matplotlib-users Info Page
--
________________________________________________________
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
________________________________________________________