From: <ef...@us...> - 2010-06-04 02:40:07
|
Revision: 8371 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8371&view=rev Author: efiring Date: 2010-06-04 02:40:00 +0000 (Fri, 04 Jun 2010) Log Message: ----------- axes: quick fix to make fill_between_demo work again Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/axes.py trunk/matplotlib/lib/matplotlib/colors.py trunk/matplotlib/lib/matplotlib/finance.py Modified: trunk/matplotlib/lib/matplotlib/axes.py =================================================================== --- trunk/matplotlib/lib/matplotlib/axes.py 2010-06-02 21:56:39 UTC (rev 8370) +++ trunk/matplotlib/lib/matplotlib/axes.py 2010-06-04 02:40:00 UTC (rev 8371) @@ -6278,13 +6278,14 @@ if interpolate: def get_interp_point(ind): - x_values = x[ind-1:ind+1] - diff_values = y1[ind-1:ind+1] - y2[ind-1:ind+1] - y1_values = y1[ind-1:ind+1] + im1 = max(ind-1, 0) + x_values = x[im1:ind+1] + diff_values = y1[im1:ind+1] - y2[im1:ind+1] + y1_values = y1[im1:ind+1] if len(diff_values) == 2: if np.ma.is_masked(diff_values[1]): - return x[ind-1], y1[ind-1] + return x[im1], y1[im1] elif np.ma.is_masked(diff_values[0]): return x[ind], y1[ind] Modified: trunk/matplotlib/lib/matplotlib/colors.py =================================================================== --- trunk/matplotlib/lib/matplotlib/colors.py 2010-06-02 21:56:39 UTC (rev 8370) +++ trunk/matplotlib/lib/matplotlib/colors.py 2010-06-04 02:40:00 UTC (rev 8371) @@ -382,10 +382,17 @@ if (c.ravel() > 1).any() or (c.ravel() < 0).any(): raise ValueError( "number in rgba sequence is outside 0-1 range") - # looks like rgba already, nothing to be done; do - # we want to apply alpha here if - # (c[:,3]==1).all() ? - return np.asarray(c, np.float) + result = np.asarray(c, np.float) + if alpha is not None: + if alpha > 1 or alpha < 0: + raise ValueError("alpha must be in 0-1 range") + result[:,3] = alpha + return result + # This alpha operation above is new, and depends + # on higher levels to refrain from setting alpha + # to values other than None unless there is + # intent to override any existing alpha values. + # It must be some other sequence of color specs. result = np.zeros((nc, 4), dtype=np.float) for i, cc in enumerate(c): Modified: trunk/matplotlib/lib/matplotlib/finance.py =================================================================== --- trunk/matplotlib/lib/matplotlib/finance.py 2010-06-02 21:56:39 UTC (rev 8370) +++ trunk/matplotlib/lib/matplotlib/finance.py 2010-06-04 02:40:00 UTC (rev 8371) @@ -42,7 +42,7 @@ where d is a floating poing representation of date, as returned by date2num - if adjust=True, use adjusted prices + if adjusted=True, use adjusted prices """ results = [] This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |