<div dir="ltr">Hi Nathan,<div><br></div><div>thank you very much, very clear explanation. Everything works fine.</div><div><br></div><div>At the moment I am a little busy to go into adding a new callback, but I will take a look when I am done!</div>
<div><br></div><div>Cheers,</div><div>                Roberto</div><div><br></div><div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On 17 September 2013 13:44, 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 Roberto,<div><br></div><div>All plot window plots (e.g. SlicePlot, ProjectionPlot and friends) expose the underlying matplotlib figure and axes like so:</div>
<div><br></div><div>slc = SlicePlot(pf, 0, 'Density')</div>

<div>plot = slc.plots['Density']</div><div><br></div><div># mpl figure</div><div>fig = plot.figure</div><div><br></div><div># mpl axes</div><div>ax = plot.axes</div><div><br></div><div>Using these objects, you can call arbitrary matplotlib functions that hang off these objects.  For example:</div>


<div><br></div><div>from matplotlib.patches import Ellipse<br></div><div>el = Ellipse((0,0), .1, .2, angle=30, facecolor='none', edgecolor='black')</div><div>ax.add_artist(Ellipse)</div><div><br></div><div>


Keep in mind that the coordinates I'm using for the Ellipse object are relative to the plot's coordinates (i.e. they will be in the same units as the x and y axis labels).</div><div><br></div><div>If you're feeling adventurous, you could try adding a new plot callback that does this in general for any plot window plot.  The source code for the callbacks are in $YT_DEST/src/yt-hg/yt/visualization/plot_modifications.py.  You could compare with the CircleCallback.</div>


<div><br></div><div>I've put together a notebook that demonstrates this.  You can view it here: <a href="http://nbviewer.ipython.org/url/hub.yt-project.org/notebooks/bcd7d3592d49496f84827abb86a738da.ipynb" target="_blank">http://nbviewer.ipython.org/url/hub.yt-project.org/notebooks/bcd7d3592d49496f84827abb86a738da.ipynb</a></div>


<div><br></div><div>HTH,</div><div><br></div><div>Nathan</div></div><div class="gmail_extra"><br><br><div class="gmail_quote"><div><div class="h5">On Mon, Sep 16, 2013 at 6:51 PM, trobolo dinni <span dir="ltr"><<a href="mailto:trobolo.trobolo.dinni5@gmail.com" target="_blank">trobolo.trobolo.dinni5@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 class="h5"><div dir="ltr">Dear yt mailing list,<div><br></div><div>I would like to ask a question about the annotations on the slice plots since I was unable to find a solution or any clue about it in the mailing list and the documentation.</div>



<div><br></div><div>I selected an ellipsoid region of my simulation through the "pf.h.ellipsoid" container, this region has particular properties and I would like to highlight it in a density slice plot by by annotating the contour of the ellipsoid (resulting in an image similar to those obtained by annotating a sphere, but with the ellipse instead).  </div>



<div><br></div><div>Is there a way to achieve this result?</div><div><br></div><div>Thanks, </div><div>                  Roberto</div><div><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><br></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>