<div dir="ltr">the changes that I suggested are only in yt 3.0.  </div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Jul 18, 2014 at 1:35 PM, Stephanie Tonnesen <span dir="ltr"><<a href="mailto:stonnes@gmail.com" target="_blank">stonnes@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"><div><div>Hi Michael,<br><br></div>Thanks for the quick reply!  I have been trying to make this work, and can't seem to get text to show up.  <br>
<br>My code looks like this:<br><br>>...<br>>import matplotlib.pylab as pl<br>
>...<div class=""><br><br>>from yt.visualization.volume_rendering.api import ColorTransferFunction<br><br>>tf = ColorTransferFunction((-29,-24))<br>>tf.add_layers(8,w=0.05,colormap="Hue Sat Value 2")<br>
>tf.sample_colormap(-26.5,w=0.02,colormap="Hue Sat Value 2")<br>
>cam = pf.h.camera([0.0,0.0,1.8],[0.0,-1.0,-0.2],4.4,1024,tf)<br><br></div>>im = cam.snapshot('rpsdip_'+sys.argv[1]+'_volumeall_vertcbar.png')<br>>tf.vert_cbar()<br>>cam.show_tf()<br>>nim=cam.draw_domain(im)<br>

>f=pl.figure()<br>>timef = (58-6)*5<br>>pl.text(0.2,0.2,np.str(timef),transform=f.transFigure, color="white")<br>>pl.text(0.2,0.82,"Tonnesen",transform=f.transFigure, color='y')<br>

>cam._render_figure=f<br>>cam.save_annotated('rpsdip_'+sys.argv[1]+'_volumeall_vertcbar_ann.png',nim,dpi=300)<br><br></div>I am getting a colorbar and the domain lines, but not the text.  I am running yt2.7-dev.  Any idea on what I am doing wrong?<br>

<div><br></div><div>Thanks,<br><br>Stephanie<br></div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Jul 18, 2014 at 10:46 AM, Michael Zingale <span dir="ltr"><<a href="mailto:michael.zingale@stonybrook.edu" target="_blank">michael.zingale@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 Stephanie, I added an optional argument to save_annotated that allows me to use an existing figure to render to.  I do something like this:<div>

<br></div><div><div>    cam = vr.Camera(c, L, W, N, transfer_function=tf, pf=pf,</div>
<div>                    no_ghost=False, #data_source=reg,                  </div><div>                    fields = [field], log_fields = [use_log])</div><div><div><br></div><div>   im = cam.snapshot()</div></div></div><div>


<br></div><div><div>    cam.draw_coordinate_vectors(im)</div></div><div><div>    cam.show_tf()</div></div><div><div>    nim = cam.draw_domain(im)</div></div><div><br></div><div><div>    f = pylab.figure()</div><div><br></div>


<div>    pylab.text(0.2, 0.85, "{:.3g} s".format(float(pf.current_time.d)),</div><div>               transform=f.transFigure, color="white")</div><div><br></div><div>    cam._render_figure = f</div></div>


<div><br></div><div><div>    cam.save_annotated("xrb_vol_{}.png".format(fname), nim, dpi=145, clear_fig=False)</div><div><br></div></div><div><br></div><div>I plan to add an example to the docs about this once I am done travelling.</div>


<div><br></div><div><br></div><div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote"><div><div>On Fri, Jul 18, 2014 at 10:41 AM, Stephanie Tonnesen <span dir="ltr"><<a href="mailto:stonnes@gmail.com" target="_blank">stonnes@gmail.com</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><div dir="ltr"><div>Hi yt-ers,<br><br></div><div>I am making individual snapshots of a simulation, using:<br>

<br>>from yt.visualization.volume_rendering.api import ColorTransferFunction<br>
<br>>tf = ColorTransferFunction((-29,-24))<br>
>tf.add_layers(8,w=0.05,colormap="Hue Sat Value 2")<br>>tf.sample_colormap(-26.5,w=0.02,colormap="Hue Sat Value 2")<br>>cam = pf.h.camera([0.0,0.0,1.8],[0.0,-1.0,-0.2],4.4,1024,tf)<br>>im = cam.snapshot('rpsdip_'+sys.argv[1]+'_volumeall.png')<br>



<br></div><div>I would like to add a timestamp to the frame (and possibly my name while I'm at it!).  I know how to add text to a plot, but am not sure how to do it here.  Any help is most appreciated!<br><br></div><div>



Thanks,<br><br>Stephanie<br></div></div>
<br></div></div>_______________________________________________<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><span><font color="#888888"><br><br clear="all"><div><br></div>-- <br><div>Michael Zingale</div><div>Associate Professor</div><div><br></div><div>Dept. of Physics & Astronomy • Stony Brook University • Stony Brook, NY 11794-3800</div>


<div><i>phone</i>:  <a href="tel:631-632-8225" value="+16316328225" target="_blank">631-632-8225</a></div><div><i>e-mail</i>: <a href="mailto:Michael.Zingale@stonybrook.edu" target="_blank">Michael.Zingale@stonybrook.edu</a></div>

<div><i>web</i>: <a href="http://www.astro.sunysb.edu/mzingale" target="_blank">http://www.astro.sunysb.edu/mzingale</a></div>

</font></span></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><br clear="all"><div><br></div>-- <br><div>Michael Zingale</div><div>Associate Professor</div><div><br></div><div>Dept. of Physics & Astronomy • Stony Brook University • Stony Brook, NY 11794-3800</div>
<div><i>phone</i>:  631-632-8225</div><div><i>e-mail</i>: <a href="mailto:Michael.Zingale@stonybrook.edu" target="_blank">Michael.Zingale@stonybrook.edu</a></div><div><i>web</i>: <a href="http://www.astro.sunysb.edu/mzingale" target="_blank">http://www.astro.sunysb.edu/mzingale</a></div>

</div>