[yt-users] title of PlotCollection

Nathan Goldbaum nathan12343 at gmail.com
Mon Jul 16 18:34:08 PDT 2012


Hi Pengfei,

I think you want to replace this line:

p.modify["title"](halos, text='z=%.2f'%z)


With the following:

p.modify["title"]('z=%.2f'%z)


Cheers,

Nathan

On 7/16/12 5:34 PM, Pengfei Chen wrote:
> Hi,
>
> I'm trying to add a title for the picture, but I can't find the right
> command to do so. Here is the code:
>
> pf = load(fn)
> halos = HaloFinder(pf)
> pc = PlotCollection(pf, [pos_x, pos_y, pos_z])
> p = pc.add_slice("Density", 0)
> pc.set_width(3*rad, '1')
> p.modify["hop_particles"](halos, max_number=100, alpha=0.3)
> p.modify["title"](halos, text='z=%.2f'%z)
>
> And there is some error reported for the last line. The meaning of the
> error is more than one name is given to the title. Then I replace it
> with:
>
> p.modify["text"](halos, pos=(0.02, 0.98), text='z=%.2f'%z)
>
> But it still has error. Could someone please help me about it?
>
> Pengfei
> _______________________________________________
> yt-users mailing list
> yt-users at lists.spacepope.org
> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org





More information about the yt-users mailing list