<div dir="ltr"><div>Hi all,<br><br>I have been trying to make a movie out of annotated projection plots but encountered the following problem:<br></div><div><br></div>------------error message-----------------------------<br>

<div>  File "...../yt/src/yt-hg/yt/visualization/plot_modifications.py", line 1157, in _get_region<br>    LE[zax] = data.center[zax] - self.width*0.5<br>

TypeError: 'NoneType' object has no attribute '__getitem__'<br><div>--------------------------------------------------------------</div><div><br></div><div>I pasted the script (copied from the yt Cookbook) I used below. It worked fine without the "prj.annotate_particles(1.0)" line. The annotation itself works too -- the figure looks good in the IPython notebook.</div>

<div><br></div><div>======Script (anim.py)==================================</div><div>import matplotlib.animation as anim<br>

from matplotlib.backends.backend_agg import FigureCanvasAgg<br>from yt.mods import *<br><br>prj = ProjectionPlot(load('DD0000/DD0000.hierarchy'), "z", 'Density')<br>prj.annotate_particles(1.0) # adding this line causes error<br>



<br>fig = prj.plots['Density'].figure<br>fig.canvas = FigureCanvasAgg(fig)<br><br>def animate(i):<br>    filename = './DD%04i/' % i + 'DD%04i' % i + '.hierarchy'<br>    pf = load(filename)<br>

    prj._switch_pf(pf)<br>

<br>density_ani = anim.FuncAnimation(fig, animate, frames=100, interval=100,<br>        blit=False)<br><br>density_ani.save('density_animation.mp4')<br clear="all">====================<br><br></div><div>Could anyone point out the problem? <br>

</div><div>

<br>Thanks in advance, <br><div>Hao<br></div>
</div></div></div>