[yt-users] Strange Behaviour in ProjectionPlot

Patrick Rieser patrick.rieser at uibk.ac.at
Mon Nov 12 09:50:31 PST 2012


Hey all,

So I still get some strange behaviour with the ProjectionPlot. If I use 
the projection.set_width() with the clumps callback method I get the 
real image shrinked inside the the plot window. Strange thing is, that 
it grows with each step! Here is a demonstration how it looks (you have 
to look closely as it doesn't grow that much each step):

http://www.flickr.com/photos/87912862@N05/sets/72157631990474435/

If I don't use the set_width() then the image itself looks fine, but the 
scale on the axis grows with each step. So it seems to be the same error 
than with fixed width.


Best wishes,
Patrick



Here is the code that I am using:

# ID is just a list of tuples with clumps/their position in an array
# sim_files and clump_files is a list containing the filenames
# get_myclump() simply returns a specific clump

for j, series in enumerate(ID):
     for i in series:
         pf = load(sim_files[i[0]])
         myclump = get_myclump(clump_files[i[0]], i[1])

         pc = ProjectionPlot(pf, axis, my_field, center = 
pf.domain_center, weight_field = my_wfield)
         pc.set_width(28, "mpc")
         pc.annotate_text([0.0,1.05], "Clump %s" % j)

         if redshift:
             pc.annotate_text([0.917,1.05], "z = %0.4f" % 
pf.current_redshift)
         if grid:
             pc.annotate_grids()
         if fix_scale:
             pc.set_zlim(my_field,boundaries[0],boundaries[1])

         pc.set_cmap("Density", "idl01")
         pc.annotate_clumps(myclump)

         pc.save('%s/Clump_%s_File_%s_Nr_%s_%s_Projection.png' % 
(myBASEDIR, j, i[0], i[1], axis))



More information about the yt-users mailing list