Bug in Fill_Between?

Is this a bug in fill_between, or is there a known workaround?

In the attached picture, I’m calling fill_between as
follows, and I can’t fill the entire area between the line (50+thresh)
and the signal, s. I realize that the areas that aren’t filled are boundary
conditions, but there should be some sort of interpolation I can do to fix this
I would think…

ax.fill_between(stockData.inds, s[stockData.rinds], 50+thresh,
where=s[stockData.rinds]>50+thresh, color=color, alpha=0.3 )

So for example: stockData.inds = range(6), s[stockData.rinds]
= [20,30,70,80,40,20] and thresh = 0. I need the areas filled with color where
stockData.rinds is greater than 50. It does fully fill in the xrange(2,3), but
the border conditions xrange(1,2) and xrange(3,4) are not fully filled under
the line.

I had the same problem with fill_over and was hoping it
would be resolved with the move to fill_between. Any ideas?

-Ryan

bug.bmp (109 KB)

There are obviously geometric solutions to this that wouldn't require interpolation -- though the interpolation is a good easy workaround. I think it would be great to file a bug for this in the tracker so it doesn't get forgotten.

Mike

Ryan Wagner wrote:

···

Is this a bug in fill_between, or is there a known workaround?

In the attached picture, I�m calling fill_between as follows, and I can�t fill the entire area between the line (50+thresh) and the signal, s. I realize that the areas that aren�t filled are boundary conditions, but there should be some sort of interpolation I can do to fix this I would think�

ax.fill_between(stockData.inds, s[stockData.rinds], 50+thresh, where=s[stockData.rinds]>50+thresh, color=color, alpha=0.3 )

So for example: stockData.inds = range(6), s[stockData.rinds] = [20,30,70,80,40,20] and thresh = 0. I need the areas filled with color where stockData.rinds is greater than 50. It does fully fill in the xrange(2,3), but the border conditions xrange(1,2) and xrange(3,4) are not fully filled under the line.

I had the same problem with fill_over and was hoping it would be resolved with the move to fill_between. Any ideas?

-Ryan

------------------------------------------------------------------------

------------------------------------------------------------------------

------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
------------------------------------------------------------------------

_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
matplotlib-users List Signup and Options
  
--
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA