[yt-users] Question in the projection plot

Matthew Turk matthewturk at gmail.com
Tue Oct 9 21:50:18 PDT 2012


Hi Nathan and Jun-Hwan,

> Unfortunately, I just tried to create a plot that way and either I'm doing
> something wrong or there's a bug somewhere that breaks this functionality.
> I could create the projection object, but when I supplied the projection
> object as a data source in add_projection, it failed (traceback
> here:http://paste.yt-project.org/show/2775/). Can someone else on the list
> let us know if I'm doing something wrong here?

I think you want to create a region, with pf.h.region, and supply that
as the data source.  The data_source gets queried from the projection.
 You could also create field cuts by using an InlineExtractedRegion
but it's probably easier to do it with a region . So the next result
would be:

reg = pf.h.region([0.5, 0.5, 0.5], [0.3, 0.0, 0.0], [0.7, 0.0, 0.0])
pc.add_projection("Density", "x", data_source=reg)

But there's also pc.add_thin_projection which does this for you and
accepts a 'thickness' argument:

http://yt-project.org/doc/api/generated/yt.visualization.plot_collection.PlotCollection.add_thin_projection.html

So,

pc.add_thin_projection("Density", "z", 0.4)

Hope that helps!

-Matt



More information about the yt-users mailing list