[yt-users] Clumps, contours, n_contours

David Collins dcollins4096 at gmail.com
Mon May 20 16:04:53 PDT 2013


Hi, Nathan--

I thought about the colorbar thing, so I made the image grayscale and it
still doesnt' show up.  I also set the zlim so that the data was either all
white or black, and it shows up in neither.

I've attached two representative images.  By construction all of these
contours are disjoint.  The missing clump is pretty obvious, as it takes up
most of the image where it exists.

The two attached plots are two tweaks to
plot_modifications.py/ClumpContourCallback, at line ~700
the "plus_3" plot uses
self.rv = plot._axes.contour(buff,  len(self.clumps)+3,
                                     extent=extent,**self.plot_args)
the "plus_5" plot uses
self.rv = plot._axes.contour(buff,  len(self.clumps)+5,
                                     extent=extent,**self.plot_args)

The code to reproduce the plot is pretty benign, and is below for
generality.  the list clumps_to_use comes from a set of pickled clumps for
this dataset.  I'll see if I can reproduce it with something more
universally accessible.  I'm quite sure that it doesn't have anything to do
with the clump itself, as I've seen this behavior with other calls to
'contour'.  I'm working on a simpler thing that demonstrates this-- I've
seen it with code that uses no piece of yt, so I'm 97.2% sure that it's
contour and not yt.  (Might be something else dumb I'm doing, that's pretty
common, but I haven't been able to sort out what it is.)

<code>
    field='Density'
    center = [0.5]*3
    proj = pf.h.proj(ax,field,center=center)
    plot = proj.to_pw(origin='domain')
    plot.set_cmap('Density','gray')
    subset = 'black_map_fixed'
    plot.set_zlim('Density',1e6,1e7)
    if clumps_to_use is not None:
        plot.annotate_clumps(clumps_to_use)
    print plot.save('%s_n%04d_%s'%(name,frame,subset))
</code>




On Mon, May 20, 2013 at 4:21 PM, Nathan Goldbaum <nathan12343 at gmail.com>wrote:

> Hi Dave,
>
> I haven't seen this.  Could this be due to the colorbar?  I believe it
> picks the contour colors based on a colorbar.  If the colors it picks are
> invisible on your plot, you won't see the contours.
>
> It would help to figure out what's going on if you could come up with a
> sample script that illustrates the issue.  Bonus points if you use one of
> the datasets on yt-project.org/data.
>
> -Nathan
>
>
> On Mon, May 20, 2013 at 3:17 PM, david collins <dcollins4096 at gmail.com>wrote:
>
>> Hi, all--
>>
>> I'm seeing a glitch in the matplotlib countor function, as employed by
>> annotate_clumps.  As is, I'm seeing some clumps that are not plotted by the
>> countour plotter unless I bump the number of contours-- I get all the plots
>> if I change the contour line to:
>>
>> self.rv = plot._axes.contour(buff, len(self.clumps)+5,
>>                                      extent=extent,**self.plot_args)
>>
>> instead of
>>
>> self.rv = plot._axes.contour(buff, len(self.clumps)+1,
>>                                      extent=extent,**self.plot_args)
>>
>>
>> Is this a glitch that anyone is aware of?  Is there a more general fix?
>>  The clump contour is not the only time I've run into this glitch. It seems
>> to happen on large contours, for what that's worth.
>>
>> Thanks!
>> d.
>>
>> _______________________________________________
>> yt-users mailing list
>> yt-users at lists.spacepope.org
>> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
>>
>>
>
> _______________________________________________
> yt-users mailing list
> yt-users at lists.spacepope.org
> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.spacepope.org/pipermail/yt-users-spacepope.org/attachments/20130520/a643f1f5/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: b204_n0080_children_hunt_plus_3_Projection_y_Density.png
Type: image/png
Size: 259905 bytes
Desc: not available
URL: <http://lists.spacepope.org/pipermail/yt-users-spacepope.org/attachments/20130520/a643f1f5/attachment-0002.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: b204_n0080_children_hunt_plus_5_Projection_y_Density.png
Type: image/png
Size: 303968 bytes
Desc: not available
URL: <http://lists.spacepope.org/pipermail/yt-users-spacepope.org/attachments/20130520/a643f1f5/attachment-0003.png>


More information about the yt-users mailing list