<div dir="ltr">If I had to guess, what's happening is that the underlying profile object (which you can think of as a 1D histogram) is poorly sampled at small radii, such that some of the histogram bins are empty.<div><br></div><div>The weirdness you're seeing at small radii is the histogram jumping from valid values near 4e9K to zero for empty histogram bins.</div><div><br></div><div>For a ProfilePlot you can take a look at the underlying histogram bins and values using a script like this:</div><div><br></div><div><a href="http://paste.yt-project.org/show/7008/">http://paste.yt-project.org/show/7008/</a><br></div><div><br></div><div>The output of running this script is here:</div><div><br></div><div><a href="http://paste.yt-project.org/show/7009/">http://paste.yt-project.org/show/7009/</a><br></div><div><br></div><div>And the ProfilePlot image it generates is here:</div><div><br></div><div><a href="http://i.imgur.com/lXILSyW.png">http://i.imgur.com/lXILSyW.png</a><br></div><div><br></div><div>Note that this uses a public test dataset from <a href="http://yt-project.org/data">yt-project.org/data</a> that you can download yourself if you want to run the script.</div><div><br></div><div>As you can see, at small radii this plot exhibits similar behavior to your plot. And if you look at the output of running the script, you'll see that indeed many of the bins at small radii (see the output of print(prof['temperature']) in my script) have values of zero. These are empty bins.</div><div><br></div><div>This is a purposeful design decision and is technically correct although possibly confusing. In principle we could fix this by choosing more "natural" uneven bin widths, but right now that has not yet been implemented. Switching between linear and logarithmically spaced bins also sometimes helps. And, as you've done, using manually chosen limits for the bins can also help by not creating any bins that will sample regions of parameter space that are poorly sampled.</div><div><br></div><div>Hope that helps you to understand what's going on.</div><div><br></div><div>-Nathan</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jan 31, 2017 at 4:39 PM, Mu-Hung Chang <span dir="ltr"><<a href="mailto:mu-hung.chang@stonybrook.edu" target="_blank">mu-hung.chang@stonybrook.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">Hi, sorry I forgot to attach the figures. Here is it.</div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jan 31, 2017 at 5:32 PM, Mu-Hung Chang <span dir="ltr"><<a href="mailto:mu-hung.chang@stonybrook.edu" target="_blank">mu-hung.chang@stonybrook.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">Hi, I've encountered a problem when I tried to use yt to visualize simple 1D detonation simulation data generated by Castro. The figure I expected to get is a simple step function just as attachment "1d_detonation_expected.png". However, if I don't set a customized axis limit by hand, it will produce something weird at the origin, which can be seen in the attachment "1d_detonation_weird.png". Following is my simple script to make plots. I wonder where I did wrong thus make this happened. Thank you for answering.<div><br></div><div><p style="margin:0px;font-size:12px;line-height:normal;font-family:courier;color:rgb(185,28,255);background-color:rgb(223,219,195)"><span style="font-variant-ligatures:no-common-ligatures">import</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(77,47,45)"> sys</span></p>
<p style="margin:0px;font-size:12px;line-height:normal;font-family:courier;color:rgb(185,28,255);background-color:rgb(223,219,195)"><span style="font-variant-ligatures:no-common-ligatures">import</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(77,47,45)"> yt</span></p>
<p style="margin:0px;font-size:12px;line-height:normal;font-family:courier;color:rgb(77,47,45);background-color:rgb(223,219,195)"><span style="font-variant-ligatures:no-common-ligatures;color:rgb(185,28,255)">import</span><span style="font-variant-ligatures:no-common-ligatures"> yt.units </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(185,28,255)">as</span><span style="font-variant-ligatures:no-common-ligatures"> u</span></p>
<p style="margin:0px;font-size:12px;line-height:normal;font-family:courier;color:rgb(77,47,45);background-color:rgb(223,219,195);min-height:14px"><span style="font-variant-ligatures:no-common-ligatures"></span><br></p>
<p style="margin:0px;font-size:12px;line-height:normal;font-family:courier;color:rgb(77,47,45);background-color:rgb(223,219,195)"><span style="font-variant-ligatures:no-common-ligatures;color:rgb(185,28,255)">def</span><span style="font-variant-ligatures:no-common-ligatures"> </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(69,36,255)">doit</span><span style="font-variant-ligatures:no-common-ligatures">(plotfile):</span></p>
<p style="margin:0px;font-size:12px;line-height:normal;font-family:courier;color:rgb(77,47,45);background-color:rgb(223,219,195)"><span style="font-variant-ligatures:no-common-ligatures">    </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(183,101,10)">ds</span><span style="font-variant-ligatures:no-common-ligatures"> = yt.load(plotfile)</span></p>
<p style="margin:0px;font-size:12px;line-height:normal;font-family:courier;color:rgb(18,141,141);background-color:rgb(223,219,195)"><span style="font-variant-ligatures:no-common-ligatures;color:rgb(77,47,45)">    </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(183,101,10)">ds.periodicity</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(77,47,45)"> = (</span><span style="font-variant-ligatures:no-common-ligatures">False</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(77,47,45)">, </span><span style="font-variant-ligatures:no-common-ligatures">False</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(77,47,45)">, </span><span style="font-variant-ligatures:no-common-ligatures">False</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(77,47,45)">)</span></p>
<p style="margin:0px;font-size:12px;line-height:normal;font-family:courier;color:rgb(77,47,45);background-color:rgb(223,219,195)"><span style="font-variant-ligatures:no-common-ligatures">    </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(183,101,10)">ad</span><span style="font-variant-ligatures:no-common-ligatures"> = ds.all_data()</span></p>
<p style="margin:0px;font-size:12px;line-height:normal;font-family:courier;color:rgb(77,47,45);background-color:rgb(223,219,195)"><span style="font-variant-ligatures:no-common-ligatures">    </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(183,101,10)">plot</span><span style="font-variant-ligatures:no-common-ligatures"> = yt.ProfilePlot(ad, </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(159,38,116)">"x"</span><span style="font-variant-ligatures:no-common-ligatures">, </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(159,38,116)">"temperature"</span><span style="font-variant-ligatures:no-common-ligatures">)</span></p>
<p style="margin:0px;font-size:12px;line-height:normal;font-family:courier;color:rgb(77,47,45);background-color:rgb(223,219,195)"><span style="font-variant-ligatures:no-common-ligatures">    plot.set_unit(</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(159,38,116)">"temperature"</span><span style="font-variant-ligatures:no-common-ligatures">, </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(159,38,116)">"K"</span><span style="font-variant-ligatures:no-common-ligatures">)</span></p>
<p style="margin:0px;font-size:12px;line-height:normal;font-family:courier;color:rgb(77,47,45);background-color:rgb(223,219,195)"><span style="font-variant-ligatures:no-common-ligatures">    plot.set_unit(</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(159,38,116)">"x"</span><span style="font-variant-ligatures:no-common-ligatures">, </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(159,38,116)">"m"</span><span style="font-variant-ligatures:no-common-ligatures">)</span></p>
<p style="margin:0px;font-size:12px;line-height:normal;font-family:courier;color:rgb(77,47,45);background-color:rgb(223,219,195)"><span style="font-variant-ligatures:no-common-ligatures">    plot.set_log(</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(159,38,116)">'x'</span><span style="font-variant-ligatures:no-common-ligatures">, </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(18,141,141)">False</span><span style="font-variant-ligatures:no-common-ligatures">)</span></p>
<p style="margin:0px;font-size:12px;line-height:normal;font-family:courier;color:rgb(77,47,45);background-color:rgb(223,219,195)"><span style="font-variant-ligatures:no-common-ligatures">    plot.set_xlim(1e-20, 450.0)</span></p>
<p style="margin:0px;font-size:12px;line-height:normal;font-family:courier;color:rgb(77,47,45);background-color:rgb(223,219,195)"><span style="font-variant-ligatures:no-common-ligatures">    </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(183,101,10)">pid</span><span style="font-variant-ligatures:no-common-ligatures"> = plotfile.split(</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(159,38,116)">"plt"</span><span style="font-variant-ligatures:no-common-ligatures">)[1]</span></p>
<p style="margin:0px;font-size:12px;line-height:normal;font-family:courier;color:rgb(159,38,116);background-color:rgb(223,219,195)"><span style="font-variant-ligatures:no-common-ligatures;color:rgb(77,47,45)">    plot.save(</span><span style="font-variant-ligatures:no-common-ligatures">"1d_detonation_{}.pn<wbr>g"</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(77,47,45)">.</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(107,107,148)">format</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(77,47,45)">(pid))</span></p>
<p style="margin:0px;font-size:12px;line-height:normal;font-family:courier;color:rgb(77,47,45);background-color:rgb(223,219,195);min-height:14px"><span style="font-variant-ligatures:no-common-ligatures"></span><br></p>
<p style="margin:0px;font-size:12px;line-height:normal;font-family:courier;color:rgb(159,38,116);background-color:rgb(223,219,195)"><span style="font-variant-ligatures:no-common-ligatures;color:rgb(185,28,255)">if</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(77,47,45)"> </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(107,107,148)">__name__</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(77,47,45)"> == </span><span style="font-variant-ligatures:no-common-ligatures">"__main__"</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(77,47,45)">:</span></p>
<p style="margin:0px;font-size:12px;line-height:normal;font-family:courier;color:rgb(77,47,45);background-color:rgb(223,219,195);min-height:14px"><span style="font-variant-ligatures:no-common-ligatures"></span><br></p>
<p style="margin:0px;font-size:12px;line-height:normal;font-family:courier;color:rgb(195,35,15);background-color:rgb(223,219,195)"><span style="font-variant-ligatures:no-common-ligatures;color:rgb(77,47,45)">    </span><span style="font-variant-ligatures:no-common-ligatures"># Choose a field                                                                                                                                                                                      </span></p>
<p style="margin:0px;font-size:12px;line-height:normal;font-family:courier;color:rgb(183,101,10);background-color:rgb(223,219,195)"><span style="font-variant-ligatures:no-common-ligatures;color:rgb(77,47,45)">    </span><span style="font-variant-ligatures:no-common-ligatures">plotfile</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(77,47,45)"> = </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(159,38,116)">""</span></p>
<p style="margin:0px;font-size:12px;line-height:normal;font-family:courier;color:rgb(77,47,45);background-color:rgb(223,219,195)"><span style="font-variant-ligatures:no-common-ligatures">    </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(185,28,255)">try</span><span style="font-variant-ligatures:no-common-ligatures">:</span></p>
<p style="margin:0px;font-size:12px;line-height:normal;font-family:courier;color:rgb(77,47,45);background-color:rgb(223,219,195)"><span style="font-variant-ligatures:no-common-ligatures">        </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(183,101,10)">plotfile</span><span style="font-variant-ligatures:no-common-ligatures"> = sys.argv[1]</span></p>
<p style="margin:0px;font-size:12px;line-height:normal;font-family:courier;color:rgb(185,28,255);background-color:rgb(223,219,195)"><span style="font-variant-ligatures:no-common-ligatures;color:rgb(77,47,45)">    </span><span style="font-variant-ligatures:no-common-ligatures">except</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(77,47,45)">:</span></p>
<p style="margin:0px;font-size:12px;line-height:normal;font-family:courier;color:rgb(159,38,116);background-color:rgb(223,219,195)"><span style="font-variant-ligatures:no-common-ligatures;color:rgb(77,47,45)">        sys.</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(18,141,141)">exit</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(77,47,45)">(</span><span style="font-variant-ligatures:no-common-ligatures">"ERROR: no plotfile specified"</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(77,47,45)">)</span></p>
<p style="margin:0px;font-size:12px;line-height:normal;font-family:courier;color:rgb(77,47,45);background-color:rgb(223,219,195)"><span style="font-variant-ligatures:no-common-ligatures">    </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(185,28,255)">for</span><span style="font-variant-ligatures:no-common-ligatures"> plt </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(185,28,255)">in</span><span style="font-variant-ligatures:no-common-ligatures"> sys.argv[1:]:</span></p>
<p style="margin:0px;font-size:12px;line-height:normal;font-family:courier;color:rgb(77,47,45);background-color:rgb(223,219,195)"><span style="font-variant-ligatures:no-common-ligatures">        </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(183,101,10)">plotfile</span><span style="font-variant-ligatures:no-common-ligatures"> = plt</span></p>
<p style="margin:0px;font-size:12px;line-height:normal;font-family:courier;color:rgb(77,47,45);background-color:rgb(223,219,195)"><span style="font-variant-ligatures:no-common-ligatures">        doit(plotfile)</span></p></div><div><br></div><div>Best, </div><span class="m_-769347380911955869HOEnZb"><font color="#888888"><div>Mu-Hung</div></font></span></div>
</blockquote></div><br></div>
</div></div><br>______________________________<wbr>_________________<br>
yt-users mailing list<br>
<a href="mailto:yt-users@lists.spacepope.org">yt-users@lists.spacepope.org</a><br>
<a href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org" rel="noreferrer" target="_blank">http://lists.spacepope.org/<wbr>listinfo.cgi/yt-users-<wbr>spacepope.org</a><br>
<br></blockquote></div><br></div>