<div dir="ltr">Hi Jeremy,<div><br></div><div>I just issued a PR that adds a bit of functionality you might be interested in.  Check it out here: </div><div><a href="https://bitbucket.org/yt_analysis/yt/pull-request/887/color-splatting/diff">https://bitbucket.org/yt_analysis/yt/pull-request/887/color-splatting/diff</a><br>

</div><div><br></div><div>You can use it like this:</div><div><div>Npix = 1024</div><div>image = np.zeros([Npix, Npix, 4], dtype='float64')</div></div><div><br></div><div>cbx = yt.visualization.color_maps.mcm.Reds<br>

</div><div><div>field = (... insert code here to get some floating point array to act as a color ... )</div><div><br></div><div># Calculate image coordinates ix and iy based on what your view width is</div><div><br></div>

<div>ix = data['particle_position_x'] * (SOME SCALING/SHIFT)</div><div><div>ix = data['particle_position_y'] * (SOME SCALING/SHIFT)</div></div><div><br></div><div>col_field = (col_field - col_field.min()) / (col_field.max() - col_field.min())</div>

<div>add_rgba_points_to_image(image, ix.astype('float64'), iy.astype('float64'), cbx(col_field))<br></div></div><div><br></div><div><div>yt.write_bitmap(image, 'all_channels.png')</div></div><div>
# OR</div>
<div><div>yt.write_bitmap(image[:,:,:3], 'no_alpha.png')</div></div><div><br></div><div>I need to document this and all that, but I'd like feedback on it if you have luck with it!  I hope to turn it into a more fully-fledged piece of yt soon.</div>

<div><br></div><div>Cheers,</div><div>Sam</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, May 7, 2014 at 7:11 PM, Andrew Myers <span dir="ltr"><<a href="mailto:atmyers2@gmail.com" target="_blank">atmyers2@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">Hi Jeremy,<div><br></div><div>I happened have a script that does this. Something like this should work (in 2.6):</div>

<div><br></div><div><div>    from yt.mods import * </div><div>    import pylab as plt</div>
<div><br></div><div>    fn = 'Chombo/releasedExamples/AMRParticleMesh/exec/output/plt256.2d.hdf5'</div><div>    pf = load(fn)</div><div> </div><div>    data = pf.h.all_data()</div><div><br></div><div>    x = data['particle_position_x']</div>


<div>    y = data['particle_position_y']</div><div><br></div><div>    plt.plot(x, y, '.')</div><div>    plt.savefig('scatter')</div></div><span class="HOEnZb"><font color="#888888"><div><br></div>

<div>-Andrew</div></font></span></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra">
<br><br><div class="gmail_quote">On Wed, May 7, 2014 at 5:12 PM, 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">Hi Jeremy,<div><br></div><div>Right now there isn't a way to do that in yt.  That's something that would be very nice to add and would probably be a good introductory yt project for someone who wanted to get more familiar with the codebase.</div>




<div><br></div><div>What you *can* do is take the particle data and plot the positions in a scatter plot using matplotlib.</div><div><br></div><div>Unfortunately I don't have a good example of that right now, but it should be pretty straightforward.  You just need to read in the x and y particle position fields and then make a scatter plot using e.g. pyplot.plot().</div>


<span><font color="#888888">

<div><br></div><div>-Nathan</div></font></span></div><div><div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, May 7, 2014 at 4:32 PM, Jeremy Ritter <span dir="ltr"><<a href="mailto:jritter@astro.as.utexas.edu" target="_blank">jritter@astro.as.utexas.edu</a>></span> wrote:<br>




<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello yt,<br>
<br>
Is there an easy way to plot only particles? What I would like to do is plot a z-axis projection of particle x/y positions, with no background data loaded from the grid. I only see examples for annotate_particles() on top of another plot, but I don't want to unnecessarily load grid data.<br>





<br>
Thanks!<br>
-Jeremy<br>
_______________________________________________<br>
yt-users mailing list<br>
<a href="mailto:yt-users@lists.spacepope.org" target="_blank">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>
</blockquote></div><br></div>
</div></div><br>_______________________________________________<br>
yt-users mailing list<br>
<a href="mailto:yt-users@lists.spacepope.org" target="_blank">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></blockquote></div><br></div>
</div></div><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></blockquote></div><br></div>