from bokeh.io import output_file, show
from bokeh.layouts import column, row
from bokeh.plotting import figure

def main():
output_file("layout.html")

# 좌표
x_coordi = list(range(11)) # 0, 1, 2, ..., 10
y0 = x_coordi
y1_coordi = [10 - i for i in x_coordi] # 10, 9, 8, ..., 0
y2_coordi = [abs(i - 5) for i in x_coordi] #

f1 = figure()
f1.circle(x_coordi, y0, size=10, color="navy", alpha=0.5)

f2 = figure()
f2.triangle(x_coordi, y1_coordi, size=10, color="firebrick", alpha=0.5)

f3 = figure()
f3.square(x_coordi, y2_coordi, size=10, color="olive", alpha=0.5)

show(row(f1, f2, f3)) # row 말고 column도 가능
if __name__ == "__main__":
main()


'언어 > python' 카테고리의 다른 글

크롤링 : 빅데이터  (0) 2018.06.25
소켓 0.2  (0) 2018.06.25
데이터 시각화 ( python 3.x ), bokeh  (0) 2018.06.14
hill 암호 코드  (0) 2018.06.12
lotto_1  (0) 2018.05.02