Thanks Matt,<div><br></div><div>      Manually creating the buffer seems to work (though John's approach of setting colormap values seems like it might be cleaner). The commands I ended up using are below. Thanks again!</div>
<div><br></div><div>    Munier</div><div><br></div><div><div><font face="courier new, monospace"><b>from yt.mods import *</b></font></div><div><font face="courier new, monospace"><b>import matplotlib.pyplot as plt</b></font></div>
<div><font face="courier new, monospace"><b>from numpy import log10 as log</b></font></div><div><font face="courier new, monospace"><b><br></b></font></div><div><font face="courier new, monospace"><b>fName = "DD0006/test_sim_0006"</b></font></div>
<div><font face="courier new, monospace"><b>var   = "star_density"</b></font></div><div><font face="courier new, monospace"><b>axis  = 0</b></font></div><div><font face="courier new, monospace"><b><br></b></font></div>
<div><font face="courier new, monospace"><b>pf = load(fName)</b></font></div><div><font face="courier new, monospace"><b>pf.h</b></font></div><div><font face="courier new, monospace"><b>proj = pf.h.proj(axis,var)</b></font></div>
<div><font face="courier new, monospace"><b><br></b></font></div><div><font face="courier new, monospace"><b>res    = [ 1000 , 1000 ]</b></font></div><div><font face="courier new, monospace"><b>c = 0.5</b></font></div><div>
<font face="courier new, monospace"><b>hw = .02</b></font></div><div><font face="courier new, monospace"><b><br></b></font></div><div><font face="courier new, monospace"><b>frb = FixedResolutionBuffer(proj,(c-hw,c+hw,c-hw,c+hw),res,antialias=False)</b></font></div>
<div><font face="courier new, monospace"><b>plt.imshow( log(frb['star_density'] + 1E-5 ) )</b></font></div><div><font face="courier new, monospace"><b>plt.savefig('tmp')</b></font></div></div><div><br></div>
<div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Nov 28, 2012 at 4:23 PM, Matthew Turk <span dir="ltr"><<a href="mailto:matthewturk@gmail.com" target="_blank">matthewturk@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Munier,<br>
<br>
Ah, my mistake -- to_frb was added in the development branch since our<br>
last release, which was in September.  You can either update to the<br>
development branch (hg up -C yt ; python2.7 setup.py develop ) or used<br>
a FixedResolutioBuffer manually (super easy to do).<br>
<br>
-Matt<br>
<br>
On Wed, Nov 28, 2012 at 4:18 PM, Munier Azzam Salem<br>
<div class="HOEnZb"><div class="h5"><<a href="mailto:msalem@astro.columbia.edu">msalem@astro.columbia.edu</a>> wrote:<br>
> Hi Matt,<br>
><br>
>       The command (on ranger, btw) gives<br>
><br>
> yt module located at:<br>
>     /share/home/01686/msalem/yt-x86_64/src/yt-hg<br>
><br>
> The current version of the code is:<br>
><br>
> ---<br>
> 6f3c1cf6960d (stable)<br>
> ---<br>
><br>
> This installation CAN be automatically updated.<br>
> Updated successfully.<br>
><br>
><br>
><br>
> On Wed, Nov 28, 2012 at 3:30 PM, Matthew Turk <<a href="mailto:matthewturk@gmail.com">matthewturk@gmail.com</a>> wrote:<br>
>><br>
>> Hi Munier,<br>
>><br>
>> That's weird, it should be in there.  What's the output of "yt<br>
>> instinfo", particularly the hash?<br>
>><br>
>> -Matt<br>
>><br>
>> On Wed, Nov 28, 2012 at 3:29 PM, Munier Azzam Salem<br>
>> <<a href="mailto:msalem@astro.columbia.edu">msalem@astro.columbia.edu</a>> wrote:<br>
>> > Hi Nathan,<br>
>> ><br>
>> >       Thanks for the tips. I think the fixed-resolution buffer is<br>
>> > exactly<br>
>> > what I need here. Unfortunately, when I run the command:<br>
>> ><br>
>> > frb = proj.to_frb(width, res, center=c)<br>
>> ><br>
>> ><br>
>> >      I get the error<br>
>> ><br>
>> > Traceback (most recent call last):<br>
>> >   File "smllPlt.py", line 16, in <module><br>
>> >     frb = proj.to_frb(width,res)<br>
>> > AttributeError: 'AMRQuadTreeProj' object has no attribute 'to_frb'<br>
>> ><br>
>> >       I tried updating my version of yt and deleting any .yt files, but<br>
>> > the<br>
>> > error stuck.<br>
>> ><br>
>> >            best,<br>
>> >              Munier<br>
>> ><br>
>> ><br>
>> ><br>
>> > On Wed, Nov 28, 2012 at 2:34 PM, Nathan Goldbaum <<a href="mailto:nathan12343@gmail.com">nathan12343@gmail.com</a>><br>
>> > wrote:<br>
>> >><br>
>> >> Hi Munier,<br>
>> >><br>
>> >> I suspect that the projection of the particle field is zero in the<br>
>> >> locations that are colored white in your image.  This causes these<br>
>> >> regions<br>
>> >> to 'fall off' the bottom end of the logarithmic color bar.<br>
>> >><br>
>> >> I think you have two options.  One would be to use a linear colorbar.<br>
>> >> You<br>
>> >> can do this following the instructions here:<br>
>> >><br>
>> >> <a href="http://yt-project.org/doc/faq/index.html#how-do-i-modify-whether-or-not-yt-takes-the-log-of-a-particular-field" target="_blank">http://yt-project.org/doc/faq/index.html#how-do-i-modify-whether-or-not-yt-takes-the-log-of-a-particular-field</a><br>

>> >><br>
>> >> Another option would be to make the plot by hand using a<br>
>> >> FixedResolutionBuffer.  In this case you would make the projection<br>
>> >> object by<br>
>> >> hand, extract the raw image buffer using an FRB, and then make the plot<br>
>> >> manually using matplotlib.  There's an example in the yt docs that<br>
>> >> covers<br>
>> >> how to do this:<br>
>> >><br>
>> >> <a href="http://yt-project.org/doc/visualizing/manual_plotting.html?highlight=manual%20plotting" target="_blank">http://yt-project.org/doc/visualizing/manual_plotting.html?highlight=manual%20plotting</a><br>

>> >><br>
>> >> In the latter case if you want the areas that project to zero to appear<br>
>> >> with a logarithmic colorbar, you'll need to manually set the regions in<br>
>> >> the<br>
>> >> FRB that are equal to zero to some small number.<br>
>> >><br>
>> >> Cheers,<br>
>> >><br>
>> >> Nathan<br>
>> >><br>
>> >> On Nov 28, 2012, at 9:29 AM, Munier Azzam Salem wrote:<br>
>> >><br>
>> >> Hi yt gurus,<br>
>> >><br>
>> >>       I've been making projections of star_density from enzo output<br>
>> >> files<br>
>> >> and they seem to be working out fine. However, wherever particles do<br>
>> >> not<br>
>> >> exist the background remains white instead of following my chosen<br>
>> >> colormap.<br>
>> >> Is there a way to paint these areas to follow the colormap?<br>
>> >><br>
>> >>        thanks!<br>
>> >>            Munier<br>
>> >><br>
>> >> I've attached an image of what gets plotted, and the relevant bits of<br>
>> >> my<br>
>> >> script are:<br>
>> >><br>
>> >> from yt.mods import *<br>
>> >><br>
>> >> fName = "DD0006/test_sim_0006"<br>
>> >> var   = "star_density"<br>
>> >> axis  = 0<br>
>> >><br>
>> >> pf = load(fName)<br>
>> >> pf.h<br>
>> >><br>
>> >> pc = PlotCollection(pf)<br>
>> >> p = pc.add_projection(var,axis)<br>
>> >> #p.modify["particles"](1.0)<br>
>> >><br>
>> >> radius = .02;<br>
>> >><br>
>> >> pc.set_xlim(.5-radius,.5+radius)<br>
>> >> pc.set_ylim(.5-radius,.5+radius)<br>
>> >><br>
>> >> pc.save(fName)<br>
>> >><br>
>> >><br>
>> >> --<br>
>> >> Munier A. Salem // 845.489.6450<br>
>> >><br>
>> >><br>
>> >> <test_sim_0006_Projection_x_star_density.png>_______________________________________________<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" target="_blank">http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org</a><br>
>> >><br>
>> >><br>
>> >><br>
>> >> _______________________________________________<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" target="_blank">http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org</a><br>
>> >><br>
>> ><br>
>> ><br>
>> ><br>
>> > --<br>
>> > Munier A. Salem // <a href="tel:845.489.6450" value="+18454896450">845.489.6450</a><br>
>> ><br>
>> > _______________________________________________<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" target="_blank">http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org</a><br>
>> ><br>
>> _______________________________________________<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" target="_blank">http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org</a><br>
>><br>
><br>
><br>
><br>
> --<br>
> Munier A. Salem // <a href="tel:845.489.6450" value="+18454896450">845.489.6450</a><br>
><br>
> _______________________________________________<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" target="_blank">http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org</a><br>
><br>
_______________________________________________<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" target="_blank">http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org</a><br>
<br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br>Munier A. Salem // 845.489.6450<br>
</div>