mirror of
https://github.com/SheffieldML/GPy.git
synced 2026-05-05 09:42:39 +02:00
[plotting] tests now working?
This commit is contained in:
parent
0402cf98e9
commit
bd128cfa8c
101 changed files with 29 additions and 115166 deletions
|
|
@ -135,26 +135,27 @@ class MatplotlibPlots(AbstractPlottingLibrary):
|
|||
if 'edgecolors' not in kwargs:
|
||||
kwargs['edgecolors'] = 'none'
|
||||
|
||||
if 'facecolors' not in kwargs:
|
||||
kwargs['facecolors'] = color
|
||||
|
||||
if 'facecolors' in kwargs:
|
||||
kwargs['facecolor'] = kwargs.pop('facecolors')
|
||||
|
||||
if 'cmap' not in kwargs:
|
||||
kwargs['cmap'] = LinearSegmentedColormap.from_list('WhToColor', ((1., 1., 1.), kwargs['facecolor']), N=len(percentiles))
|
||||
kwargs['cmap']._init()
|
||||
color = kwargs.pop('facecolors')
|
||||
|
||||
if 'array' in kwargs:
|
||||
array = kwargs.pop('array')
|
||||
else:
|
||||
array = 1.-np.abs(np.linspace(-.97, .97, len(percentiles)-1))
|
||||
|
||||
if 'alpha' in kwargs:
|
||||
kwargs['cmap']._lut[:, -1] = kwargs['alpha']
|
||||
|
||||
if 'array' not in kwargs:
|
||||
if (len(percentiles)%2) == 0:
|
||||
up = np.linspace(0, 1, len(percentiles)/2)
|
||||
kwargs['array'] = np.r_[up, up[::-1][1:]]
|
||||
else:
|
||||
up = np.linspace(0, 1, len(percentiles)/2)
|
||||
kwargs['array'] = np.r_[up, up[::-1]]
|
||||
alpha = kwargs.pop('alpha')
|
||||
else:
|
||||
alpha = .8
|
||||
|
||||
if 'cmap' in kwargs:
|
||||
cmap = kwargs.pop('cmap')
|
||||
else:
|
||||
cmap = LinearSegmentedColormap.from_list('WhToColor', (color, color), N=array.size)
|
||||
cmap._init()
|
||||
cmap._lut[:-3, -1] = alpha*array
|
||||
|
||||
kwargs['facecolors'] = [cmap(i) for i in np.linspace(0,1,cmap.N)]
|
||||
|
||||
# pop where from kwargs
|
||||
where = kwargs.pop('where') if 'where' in kwargs else None
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue