bokeh
[bokeh] 패치, 폴리곤 (Patch, Polygons)
J3SUNG
2020. 10. 5. 05:23
728x90
단일 패치 (Single Patches)
p = figure(plot_width=400, plot_height=400)
p.patch([1, 2, 3, 4, 5], [5, 7, 8, 5, 2], alpha=0.5, line_width=1)
show(p)
다중 패치 (Multiple Patch)
p = figure(plot_width=400, plot_height=400)
p.patches([[1, 2, 3], [3, 4, 5, 6]], [[1, 5, 2], [3, 2, 2, 4]],
color=["orange", "green"], alpha=[0.5, 0.5], line_width=2)
show(p)
폴리곤 (Polygons)
p = figure(plot_width=400, plot_height=400)
p.multi_polygons(xs=[[[[1, 1, 2, 2]]]],
ys=[[[[2, 4, 4, 2]]]])
show(p)
p = figure(plot_width=400, plot_height=400)
p.multi_polygons(xs=[[[[1, 1, 2, 2], [1.2, 1.6, 1.6, 1.2], [1.8, 1.8, 1.6]]]],
ys=[[[[2, 4, 4, 2], [3.2, 3.6, 3.2, 3.6], [2.4, 2.8, 2.8]]]])
show(p)
p = figure(plot_width=400, plot_height=400)
p.multi_polygons(xs=[[[ [1, 1, 2, 2], [1.2, 1.6, 1.6, 1.2], [1.8, 1.8, 1.6] ]],
[[ [1, 2, 2, 1], [1.3, 1.3, 1.6, 1.6] ]]],
ys=[[[ [2, 4, 4, 2], [3.2, 3.6, 3.2, 3.6], [2.4, 2.8, 2.8] ]],
[[ [1, 1, 2, 2], [1.3, 1.6, 1.6, 1.3] ]]],
color=['darkblue', 'darkred'])
show(p)
.