colorful multiflex
This commit is contained in:
@@ -81,17 +81,24 @@ def errorbar(fig, x, y, source=ColumnDataSource(),
|
||||
|
||||
xerrvalues = source.data['xerror']
|
||||
yerrvalues = source.data['yerror']
|
||||
|
||||
|
||||
try:
|
||||
colorvalues = source.data['color']
|
||||
except KeyError:
|
||||
colorvalues = ["#%02x%02x%02x" % (255,0,0) for x in xvalues]
|
||||
|
||||
|
||||
try:
|
||||
a = xvalues[0]+1
|
||||
if xerr:
|
||||
x_err_x = []
|
||||
x_err_y = []
|
||||
for px, py, err in zip(xvalues, yvalues, xerrvalues):
|
||||
err_color = []
|
||||
for px, py, err, color in zip(xvalues, yvalues, xerrvalues, colorvalues):
|
||||
x_err_x.append((px - err, px + err))
|
||||
x_err_y.append((py, py))
|
||||
fig.multi_line(x_err_x, x_err_y, color=color,
|
||||
err_color.append(color)
|
||||
|
||||
fig.multi_line(x_err_x, x_err_y, color=err_color,
|
||||
name='xerr',
|
||||
**error_kwargs)
|
||||
except TypeError:
|
||||
@@ -102,10 +109,13 @@ def errorbar(fig, x, y, source=ColumnDataSource(),
|
||||
if yerr:
|
||||
y_err_x = []
|
||||
y_err_y = []
|
||||
for px, py, err in zip(xvalues, yvalues, yerrvalues):
|
||||
err_color = []
|
||||
for px, py, err, color in zip(xvalues, yvalues, yerrvalues, colorvalues):
|
||||
y_err_x.append((px, px))
|
||||
y_err_y.append((py - err, py + err))
|
||||
fig.multi_line(y_err_x, y_err_y, color=color,
|
||||
err_color.append(color)
|
||||
|
||||
fig.multi_line(y_err_x, y_err_y, color=err_color,
|
||||
name='yerr',**error_kwargs)
|
||||
except TypeError:
|
||||
pass
|
||||
@@ -1279,13 +1289,15 @@ def interactive_multiflex(datadf,xparam,yparam,groupby,extratitle='',
|
||||
)
|
||||
|
||||
errorbar(plot,xparam,yparam,source=source,
|
||||
xerr=ploterrorbars,
|
||||
yerr=ploterrorbars,
|
||||
point_kwargs={
|
||||
'line_color':None,
|
||||
'legend':yparamname,
|
||||
'size':"groupsize",
|
||||
})
|
||||
xerr=ploterrorbars,
|
||||
yerr=ploterrorbars,
|
||||
point_kwargs={
|
||||
'line_color':None,
|
||||
'legend':yparamname,
|
||||
'size':"groupsize",
|
||||
'fill_color':"color",
|
||||
},
|
||||
)
|
||||
|
||||
if xparam == 'workoutid':
|
||||
plot.xaxis.axis_label = 'Workout'
|
||||
|
||||
Reference in New Issue
Block a user