Pustaka Taratsa

Baca teks (EPUB): Bokeh: Plot Beberapa Graph dalam satu canvas

1 bagian

Teks ini diambil langsung dari berkas EPUB; tata letak dan gambar tidak disertakan. Untuk tampilan lengkap, silakan merujuk pada dokumen asli.

Daftar isi
  1. Bokeh: Plot Beberapa Graph dalam satu canvas
  2. Referensi

Bokeh: Plot Beberapa Graph dalam satu canvas

Sumber: https://onnocenter.or.id/wiki/index.php/Bokeh:_Plot_Beberapa_Graph_dalam_satu_canvas

Sumber: http://bokeh.pydata.org/en/0.9.3/docs/user_guide/layout.html

from bokeh.io import output_file, show, vplot
from bokeh.plotting import figure

output_file("layout.html")

x = list(range(11))
y0 = x
y1 = [10 - i for i in x]
y2 = [abs(i - 5) for i in x]

# create a new plot
s1 = figure(width=250, plot_height=250, title=None)
s1.circle(x, y0, size=10, color="navy", alpha=0.5)

# create another one
s2 = figure(width=250, height=250, title=None)
s2.triangle(x, y1, size=10, color="firebrick", alpha=0.5)

# create and another
s3 = figure(width=250, height=250, title=None)
s3.square(x, y2, size=10, color="olive", alpha=0.5)

# put all the plots in a VBox
p = vplot(s1, s2, s3)

# show the results
show(p)

Referensi