<div dir="ltr">Hi, Matt-<div><br></div><div>That's a good idea.  I tried </div><div>np.unique(buff)</div><div style>and it fixed the problem.  Should I make a PR with this change? </div><div style><br></div><div style>

d.</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, May 21, 2013 at 7:16 AM, Matthew Turk <span dir="ltr"><<a href="mailto:matthewturk@gmail.com" target="_blank">matthewturk@gmail.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Dave,<br>
<br>
I think the way contours works is that it sets N contours.  What might<br>
work better, since we're contouring images, would be to explicitly<br>
specify the contours.  Can you test if something like range(N+1) works<br>
better, rather than len(contours)?<br>
<br>
-Matt<br>
<div class="HOEnZb"><div class="h5"><br>
On Mon, May 20, 2013 at 7:04 PM, David Collins <<a href="mailto:dcollins4096@gmail.com">dcollins4096@gmail.com</a>> wrote:<br>
> Hi, Nathan--<br>
><br>
> I thought about the colorbar thing, so I made the image grayscale and it<br>
> still doesnt' show up.  I also set the zlim so that the data was either all<br>
> white or black, and it shows up in neither.<br>
><br>
> I've attached two representative images.  By construction all of these<br>
> contours are disjoint.  The missing clump is pretty obvious, as it takes up<br>
> most of the image where it exists.<br>
><br>
> The two attached plots are two tweaks to<br>
> <a href="http://plot_modifications.py/ClumpContourCallback" target="_blank">plot_modifications.py/ClumpContourCallback</a>, at line ~700<br>
> the "plus_3" plot uses<br>
> self.rv = plot._axes.contour(buff,  len(self.clumps)+3,<br>
>                                      extent=extent,**self.plot_args)<br>
> the "plus_5" plot uses<br>
><br>
> self.rv = plot._axes.contour(buff,  len(self.clumps)+5,<br>
>                                      extent=extent,**self.plot_args)<br>
><br>
> The code to reproduce the plot is pretty benign, and is below for<br>
> generality.  the list clumps_to_use comes from a set of pickled clumps for<br>
> this dataset.  I'll see if I can reproduce it with something more<br>
> universally accessible.  I'm quite sure that it doesn't have anything to do<br>
> with the clump itself, as I've seen this behavior with other calls to<br>
> 'contour'.  I'm working on a simpler thing that demonstrates this-- I've<br>
> seen it with code that uses no piece of yt, so I'm 97.2% sure that it's<br>
> contour and not yt.  (Might be something else dumb I'm doing, that's pretty<br>
> common, but I haven't been able to sort out what it is.)<br>
><br>
> <code><br>
>     field='Density'<br>
>     center = [0.5]*3<br>
>     proj = pf.h.proj(ax,field,center=center)<br>
>     plot = proj.to_pw(origin='domain')<br>
>     plot.set_cmap('Density','gray')<br>
>     subset = 'black_map_fixed'<br>
>     plot.set_zlim('Density',1e6,1e7)<br>
>     if clumps_to_use is not None:<br>
>         plot.annotate_clumps(clumps_to_use)<br>
>     print plot.save('%s_n%04d_%s'%(name,frame,subset))<br>
> </code><br>
><br>
><br>
><br>
><br>
> On Mon, May 20, 2013 at 4:21 PM, Nathan Goldbaum <<a href="mailto:nathan12343@gmail.com">nathan12343@gmail.com</a>><br>
> wrote:<br>
>><br>
>> Hi Dave,<br>
>><br>
>> I haven't seen this.  Could this be due to the colorbar?  I believe it<br>
>> picks the contour colors based on a colorbar.  If the colors it picks are<br>
>> invisible on your plot, you won't see the contours.<br>
>><br>
>> It would help to figure out what's going on if you could come up with a<br>
>> sample script that illustrates the issue.  Bonus points if you use one of<br>
>> the datasets on <a href="http://yt-project.org/data" target="_blank">yt-project.org/data</a>.<br>
>><br>
>> -Nathan<br>
>><br>
>><br>
>> On Mon, May 20, 2013 at 3:17 PM, david collins <<a href="mailto:dcollins4096@gmail.com">dcollins4096@gmail.com</a>><br>
>> wrote:<br>
>>><br>
>>> Hi, all--<br>
>>><br>
>>> I'm seeing a glitch in the matplotlib countor function, as employed by<br>
>>> annotate_clumps.  As is, I'm seeing some clumps that are not plotted by the<br>
>>> countour plotter unless I bump the number of contours-- I get all the plots<br>
>>> if I change the contour line to:<br>
>>><br>
>>> self.rv = plot._axes.contour(buff, len(self.clumps)+5,<br>
>>>                                      extent=extent,**self.plot_args)<br>
>>><br>
>>> instead of<br>
>>><br>
>>> self.rv = plot._axes.contour(buff, len(self.clumps)+1,<br>
>>>                                      extent=extent,**self.plot_args)<br>
>>><br>
>>><br>
>>> Is this a glitch that anyone is aware of?  Is there a more general fix?<br>
>>> The clump contour is not the only time I've run into this glitch. It seems<br>
>>> to happen on large contours, for what that's worth.<br>
>>><br>
>>> Thanks!<br>
>>> d.<br>
>>><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>
>><br>
>><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>
><br>
><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>
_______________________________________________<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>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br>Sent from my computer.
</div>