<div dir="ltr"><div class="gmail_default"><div class="gmail_default"><font face="arial, helvetica, sans-serif">Hi Nathan,</font></div><div class="gmail_default"><font face="arial, helvetica, sans-serif"><br></font></div><div class="gmail_default"><font face="arial, helvetica, sans-serif">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.</font></div><div class="gmail_default"><font face="arial, helvetica, sans-serif"><br></font></div><div class="gmail_default"><font face="arial, helvetica, sans-serif">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?</font></div><div class="gmail_default"><font face="arial, helvetica, sans-serif"><br></font></div><div class="gmail_default"><font face="arial, helvetica, sans-serif">Jon</font></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Dec 15, 2016 at 12:00 PM, Slavin, Jonathan <span dir="ltr"><<a href="mailto:jslavin@cfa.harvard.edu" target="_blank">jslavin@cfa.harvard.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small">Thanks Nathan.  I'll check it out.</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small">Jon</div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Dec 15, 2016 at 11:41 AM, Nathan Goldbaum <span dir="ltr"><<a href="mailto:nathan12343@gmail.com" target="_blank">nathan12343@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">yt uses an implementation of the line integral convolution recipe from scipy that works very nicely (IMO):<div><br></div><div><a href="http://yt-project.org/docs/dev/visualizing/callbacks.html#overplot-line-integral-convolution" target="_blank">http://yt-project.org/docs/dev<wbr>/visualizing/callbacks.html#<wbr>overplot-line-integral-convolu<wbr>tion</a><br></div><div><br></div><div>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:</div><div><br></div><div><a href="https://bitbucket.org/yt_analysis/yt/src/011cd19563215cefb3facfd5d6f575b6b38de0db/yt/visualization/plot_modifications.py?at=yt&fileviewer=file-view-default#plot_modifications.py-2347" target="_blank">https://bitbucket.org/yt_analy<wbr>sis/yt/src/011cd19563215cefb3f<wbr>acfd5d6f575b6b38de0db/yt/<wbr>visualization/plot_<wbr>modifications.py?at=yt&filevie<wbr>wer=file-view-default#plot_<wbr>modifications.py-2347</a><br></div><div><br></div><div><a href="https://bitbucket.org/yt_analysis/yt/src/011cd19563215cefb3facfd5d6f575b6b38de0db/yt/utilities/lib/line_integral_convolution.pyx?at=yt&fileviewer=file-view-default" target="_blank">https://bitbucket.org/yt_analy<wbr>sis/yt/src/011cd19563215cefb3f<wbr>acfd5d6f575b6b38de0db/yt/<wbr>utilities/lib/line_integral_<wbr>convolution.pyx?at=yt&<wbr>fileviewer=file-view-default</a><br></div></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="m_8264541530680885641h5">On Thu, Dec 15, 2016 at 10:38 AM, Slavin, Jonathan <span dir="ltr"><<a href="mailto:jslavin@cfa.harvard.edu" target="_blank">jslavin@cfa.harvard.edu</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="m_8264541530680885641h5"><div dir="ltr"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small">Hi all,</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small">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.</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small">Regards,</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small">Jon</div><span class="m_8264541530680885641m_2566849462497121378HOEnZb"><font color="#888888"><div><br></div>-- <br><div class="m_8264541530680885641m_2566849462497121378m_7735865888109149873gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr">______________________________<wbr>__________________________<br>Jonathan D. Slavin                 Harvard-Smithsonian CfA<br><a href="mailto:jslavin@cfa.harvard.edu" target="_blank">jslavin@cfa.harvard.edu</a>       60 Garden Street, MS 83<br>phone: <a href="tel:(617)%20496-7981" value="+16174967981" target="_blank">(617) 496-7981</a>       Cambridge, MA 02138-1516<br>cell: <a href="tel:(781)%20363-0035" value="+17813630035" target="_blank">(781) 363-0035</a>             USA<br>______________________________<wbr>__________________________<br><br></div></div></div></div>
</font></span></div>
<br></div></div>______________________________<wbr>_________________<br>
Matplotlib-users mailing list<br>
<a href="mailto:Matplotlib-users@python.org" target="_blank">Matplotlib-users@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/matplotlib-users" rel="noreferrer" target="_blank">https://mail.python.org/mailma<wbr>n/listinfo/matplotlib-users</a><br>
<br></blockquote></div><br></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="m_8264541530680885641gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr">______________________________<wbr>__________________________<br>Jonathan D. Slavin                 Harvard-Smithsonian CfA<br><a href="mailto:jslavin@cfa.harvard.edu" target="_blank">jslavin@cfa.harvard.edu</a>       60 Garden Street, MS 83<br>phone: <a href="tel:(617)%20496-7981" value="+16174967981" target="_blank">(617) 496-7981</a>       Cambridge, MA 02138-1516<br>cell: <a href="tel:(781)%20363-0035" value="+17813630035" target="_blank">(781) 363-0035</a>             USA<br>______________________________<wbr>__________________________<br><br></div></div></div></div>
</div>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr">________________________________________________________<br>Jonathan D. Slavin                 Harvard-Smithsonian CfA<br><a href="mailto:jslavin@cfa.harvard.edu" target="_blank">jslavin@cfa.harvard.edu</a>       60 Garden Street, MS 83<br>phone: (617) 496-7981       Cambridge, MA 02138-1516<br>cell: (781) 363-0035             USA<br>________________________________________________________<br><br></div></div></div></div>
</div>