Private
Public Access
1
0

blue single hue color scheme

This commit is contained in:
Sander Roosendaal
2017-07-11 11:13:17 +02:00
parent 5105834873
commit 447c833fa7
2 changed files with 24 additions and 9 deletions

View File

@@ -1,3 +1,4 @@
import colorsys
from rowers.models import Workout, User, Rower, WorkoutForm,RowerForm,GraphImage
from rowingdata import rower as rrower
from rowingdata import main as rmain
@@ -73,8 +74,6 @@ def errorbar(fig, x, y, source=ColumnDataSource(),
xerr=False, yerr=False, color='black',
point_kwargs={}, error_kwargs={}):
fig.circle(x, y, source=source, name='data',color=color,
**point_kwargs)
xvalues = source.data[x]
yvalues = source.data[y]
@@ -96,7 +95,12 @@ def errorbar(fig, x, y, source=ColumnDataSource(),
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))
err_color.append(color)
(r, g, b) = tuple(int(color[i:i+2],16) for i in (1, 3, 5))
h,s,v = colorsys.rgb_to_hsv(r/255., g/255., b/255.)
v = v*0.8
r, g, b = colorsys.hsv_to_rgb(h, s, v)
color2 = "#%02x%02x%02x" % (int(255.*r), int(255.*g), int(255*b))
err_color.append(color2)
fig.multi_line(x_err_x, x_err_y, color=err_color,
name='xerr',
@@ -113,13 +117,22 @@ def errorbar(fig, x, y, source=ColumnDataSource(),
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))
err_color.append(color)
(r, g, b) = tuple(int(color[i:i+2],16) for i in (1, 3, 5))
h,s,v = colorsys.rgb_to_hsv(r/255., g/255., b/255.)
v = v*0.8
r, g, b = colorsys.hsv_to_rgb(h, s, v)
color2 = "#%02x%02x%02x" % (int(255.*r), int(255.*g), int(255*b))
err_color.append(color2)
fig.multi_line(y_err_x, y_err_y, color=err_color,
name='yerr',**error_kwargs)
except TypeError:
pass
fig.circle(x, y, source=source, name='data',color=color,
**point_kwargs)
def tailwind(bearing,vwind,winddir):
""" Calculates head-on head/tailwind in direction of rowing
@@ -1292,7 +1305,7 @@ def interactive_multiflex(datadf,xparam,yparam,groupby,extratitle='',
xerr=ploterrorbars,
yerr=ploterrorbars,
point_kwargs={
'line_color':"black",
'line_color':"#969696",
'size':"groupsize",
'fill_color':"color",
},