Skip to content

Commit 3f74a7b

Browse files
authored
Merge pull request #243 from cxhernandez/fix-plot
Fix plot
2 parents 0a22ce1 + 8a0fcfe commit 3f74a7b

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

osprey/plot.py

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,16 @@ def nonconstant_parameters(data):
2828
return filtered
2929

3030

31-
def build_scatter_tooltip(x, y, tt, add_line=True, radius=3, title='My Plot',
31+
def build_scatter_tooltip(x, y, tt, add_line=True, radius=.1, title='My Plot',
3232
xlabel='Iteration number', ylabel='Score'):
3333
p = bk.figure(title=title, tools=TOOLS)
3434

35+
tt['x'] = x
36+
tt['y'] = y
37+
tt['radius'] = radius
38+
3539
p.circle(
36-
x, y, radius=radius, source=ColumnDataSource(tt),
40+
x='x', y='y', radius='radius', source=tt,
3741
fill_alpha=0.6, line_color=None)
3842

3943
if add_line:
@@ -99,9 +103,13 @@ def plot_3(data, ss, *args):
99103

100104
df_params = nonconstant_parameters(data)
101105
df_params['score'] = scores
106+
df_params['x'] = X[:, 0]
107+
df_params['y'] = X[:, 1]
108+
df_params['color'] = mapped_colors
109+
df_params['radius'] = 1
102110
p.circle(
103-
X[:, 0], X[:, 1], color=mapped_colors, radius=1,
104-
source=ColumnDataSource(df_params), fill_alpha=0.6,
111+
x='x', y='y', color='color', radius='radius',
112+
source=ColumnDataSource(data=df_params), fill_alpha=0.6,
105113
line_color=None)
106114
cp = p
107115
hover = cp.select(dict(type=HoverTool))

0 commit comments

Comments
 (0)