from
bokeh.io
import
show
from
bokeh.models
import
Legend
from
bokeh.plotting
import
figure
import
numpy as np
x1
=
[
7
,
8
,
4
,
3
,
2
,
9
,
10
,
11
,
6
,
6
,
3
]
y1
=
[
10
,
11
,
12
,
13
,
14
,
15
,
16
,
17
,
18
,
19
,
20
]
fig
=
figure(plot_height
=
600
, plot_width
=
600
)
point1
=
fig.circle(x
=
np.arange(
14
),
y
=
[
14
,
13
,
12
,
11
,
10
,
9
,
8
,
7
,
6
,
5
,
4
,
3
,
2
,
1
])
point2
=
fig.triangle(x
=
[
1
,
2
,
3
,
4
,
5
,
6
,
7
,
8
,
9
,
10
,
11
,
12
,
13
,
14
],
y
=
[
1
,
4
,
9
,
16
,
25
,
36
,
49
,
64
,
81
,
100
,
121
,
144
,
169
,
196
], size
=
30
,
color
=
"green"
, alpha
=
0.5
)
point3
=
fig.diamond(x
=
[
1
,
2
,
4
],
y
=
[
20
,
19
,
1
],
color
=
"red"
,
alpha
=
0.4
)
point4
=
fig.square(x
=
[
70
,
80
,
40
,
30
,
20
,
10
],
y
=
[
10
,
20
,
40
,
50
,
60
,
70
],
color
=
"red"
, size
=
20
,
alpha
=
0.6
)
point5
=
fig.inverted_triangle(x
=
[
75
,
85
,
45
,
35
,
25
,
15
],
y
=
[
15
,
25
,
45
,
55
,
65
,
75
],
color
=
"purple"
, size
=
10
, alpha
=
0.6
)
point6
=
fig.square(x1, y1, color
=
"yellow"
,
size
=
20
, alpha
=
0.6
)
legend1
=
Legend(items
=
[(
"point1"
, [point1]),
(
"point2"
, [point2])],
location
=
(
10
,
10
), orientation
=
"horizontal"
)
legend2
=
Legend(items
=
[(
"point3"
, [point3]), (
"point4"
, [point4])],
location
=
(
10
,
10
), orientation
=
"horizontal"
)
legend3
=
Legend(items
=
[(
"point5"
, [point5]), (
"point6"
, [point6])],
location
=
(
10
,
10
), orientation
=
"horizontal"
)
fig.add_layout(legend1,
'below'
)
fig.add_layout(legend2,
'below'
)
fig.add_layout(legend3,
'below'
)
show(fig)