<div dir="ltr"><div class="gmail_default" style="font-family:tahoma,sans-serif;font-size:small">Mattia,</div><div class="gmail_default" style="font-family:tahoma,sans-serif;font-size:small"><br></div><div class="gmail_default" style="font-family:tahoma,sans-serif;font-size:small">If you want a profile along a line with arbitrary orientation, I'd recommend using the ray yt object.</div><div class="gmail_default" style="font-family:tahoma,sans-serif;font-size:small">ds = yt.load(filename)</div><div class="gmail_default" style="font-family:tahoma,sans-serif;font-size:small">ray = ds.r[(r1,z1,0):(r2,z2,0)]</div><div class="gmail_default" style="font-family:tahoma,sans-serif;font-size:small">rsort = np.argsort(ray['t'])</div><div class="gmail_default" style="font-family:tahoma,sans-serif;font-size:small">rr = ray['gas','r'][rsort]</div><div class="gmail_default" style="font-family:tahoma,sans-serif;font-size:small">zz = ray['gas','z'][rsort]</div><div class="gmail_default" style="font-family:tahoma,sans-serif;font-size:small">d = np.sqrt((rr-rr[0])**2 + (zz-zz[0])**2)<br>dens = ray['gas','density'][rsort]<br></div><div class="gmail_default" style="font-family:tahoma,sans-serif;font-size:small">fig,ax = plt.subplots()</div><div class="gmail_default" style="font-family:tahoma,sans-serif;font-size:small">ax.plot(d,dens)</div><div class="gmail_default" style="font-family:tahoma,sans-serif;font-size:small">plt.show()</div><div class="gmail_default" style="font-family:tahoma,sans-serif;font-size:small"><br></div><div class="gmail_default" style="font-family:tahoma,sans-serif;font-size:small">The rsort bit is explained on the yt site. When constructing rays, the order may not be what you'd expect. the 't' variable of a ray is a parametric variable that goes from 0 to 1.</div><div class="gmail_default" style="font-family:tahoma,sans-serif;font-size:small"><br></div><div class="gmail_default" style="font-family:tahoma,sans-serif;font-size:small">Regards,</div><div class="gmail_default" style="font-family:tahoma,sans-serif;font-size:small">Jon</div><span class="gmail_signature_prefix">-- </span><br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><img src="https://lh6.googleusercontent.com/mJuf9zI6QC5w6HPVCinnLSkpp-RgufOfl7nw1E_aghDflNhusoRbZTuP_0x-RkECQRhIfvPxGMe6zSt6chyXZ7D5DdqtkZPp0q-TE8itKny8VWObWAiZ1aurYWDO0CtZgvJEXfzu" width="350" height="2" style="font-size:12.6667px;font-family:Arial;white-space:pre-wrap;border:none"></div><div dir="ltr">Jonathan D. Slavin (he/him)</div><div dir="ltr">Astrophysicist - High Energy Astrophysics Division</div><div dir="ltr">Center for Astrophysics | Harvard & Smithsonian</div><div dir="ltr">Office: (617) 496-7981 | Cell: (781) 363-0035<br>60 Garden Street | MS 04 | Cambridge, MA 02138</div></div><div dir="ltr"><span><p dir="ltr" style="line-height:1.2;margin-top:0pt;margin-bottom:0pt"><span style="font-size:9.5pt;font-family:Arial;background-color:transparent;vertical-align:baseline;white-space:pre-wrap"><img src="https://lh6.googleusercontent.com/mJuf9zI6QC5w6HPVCinnLSkpp-RgufOfl7nw1E_aghDflNhusoRbZTuP_0x-RkECQRhIfvPxGMe6zSt6chyXZ7D5DdqtkZPp0q-TE8itKny8VWObWAiZ1aurYWDO0CtZgvJEXfzu" width="350" height="2" style="border:none"></span><span style="font-size:9.5pt;font-family:Arial;background-color:transparent;vertical-align:baseline;white-space:pre-wrap"><br></span></p></span></div></div></div></div></div></div></div></div>