끄적끄적 코딩
article thumbnail

단일 패치 (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)

.

'bokeh' 카테고리의 다른 글

[bokeh] 이미지 (Images)  (0) 2020.10.05
[bokeh] 계란형 (Ovals)  (0) 2020.10.05
[bokeh] 영역 (Areas)  (0) 2020.10.05
[bokeh] 막대, 사각형, 육각 타일  (0) 2020.10.04
[bokeh] 라인 플롯 (Line Plots)  (0) 2020.10.04

검색 태그