[yt-users] Overlaying matplotlib plots on yt plots

DORIS LEE dorislee at berkeley.edu
Mon Jun 1 21:13:51 PDT 2015


Hi all,

I have been trying to plot a circle of a given radius around the boundary
of a collapsing cloud to track its evolution.
Usually in matplotlib, I would just draw a circle using a xy meshgrid, but
if I do this using matplotlib the circle would be on a separate figure and
not overlaid on the yt plot. So I tried using a PlotWindow to separate the
data and the yt plot  but I get this error:

In [92]:yt.visualization.plot_window.PlotWindow(proj,(-1e5,1e5,-1e5,1e5))

AttributeError: 'ProjectionPlot' object has no attribute '_key_fields'


In general, is there to get my RAMSES data loaded into yt as a numpy array
with actual numbers in them then feed it into matplotlib to do this task?
or alternatively, is there a simpler way to do this directly on yt using
annotate_contour or some other yt function?

Thank you.

Regards,
Doris
----
Code for generating the attached plot, the green boundary line is in theory
what I am trying to draw.

ds= yt.load("../../bin/output_00002/info_00002.txt")
proj = yt.ProjectionPlot(ds, "y", "density",window_size=10)
proj.set_cmap("density","rainbow")
proj.annotate_velocity()
proj.show()
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.spacepope.org/pipermail/yt-users-spacepope.org/attachments/20150601/2c59dbe0/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: rho.png
Type: image/png
Size: 137072 bytes
Desc: not available
URL: <http://lists.spacepope.org/pipermail/yt-users-spacepope.org/attachments/20150601/2c59dbe0/attachment.png>


More information about the yt-users mailing list