顯示交互式散景圖。
Bokeh 是 Python 的圖表庫。此函數的參數緊跟 Bokeh 的 show
函數的參數。您可以在 https://bokeh.pydata.org 找到更多關於散景的信息。
函數簽名
st.bokeh_chart(figure, use_container_width=False)
參數 | 說明 |
---|---|
figure (bokeh.plotting.figure.Figure) | 要繪製的散景圖。 |
use_container_width (bool) | 如果為 True,則將圖表寬度設置為列寬。這優先於 Bokeh 的原生 |
To show Bokeh charts in Streamlit, call `st.bokeh_chart` (null) | 沒有說明 |
wherever you would call Bokeh's `show`. (null) | 沒有說明 |
示例
import streamlit as st
from bokeh.plotting import figure
x = [1, 2, 3, 4, 5]
y = [6, 7, 2, 4, 5]
p = figure(
title='simple line example',
x_axis_label='x',
y_axis_label='y')
p.line(x, y, legend_label='Trend', line_width=2)
st.bokeh_chart(p, use_container_width=True)
相關用法
- Python Streamlit st.bar_chart用法及代碼示例
- Python Streamlit st.balloons用法及代碼示例
- Python Streamlit st.button用法及代碼示例
- Python Streamlit st.experimental_singleton.clear用法及代碼示例
- Python Streamlit st.caption用法及代碼示例
- Python Streamlit st.text_input用法及代碼示例
- Python Streamlit st.area_chart用法及代碼示例
- Python Streamlit st.title用法及代碼示例
- Python Streamlit st.cache用法及代碼示例
- Python Streamlit st.experimental_singleton用法及代碼示例
- Python Streamlit st.empty用法及代碼示例
- Python Streamlit st.error用法及代碼示例
- Python Streamlit st.video用法及代碼示例
- Python Streamlit st.vega_lite_chart用法及代碼示例
- Python Streamlit st.slider用法及代碼示例
- Python Streamlit st.header用法及代碼示例
- Python Streamlit st.container用法及代碼示例
- Python Streamlit st.form_submit_button用法及代碼示例
- Python Streamlit st.form用法及代碼示例
- Python Streamlit st.plotly_chart用法及代碼示例
- Python Streamlit st.code用法及代碼示例
- Python Streamlit st.experimental_memo.clear用法及代碼示例
- Python Streamlit st.warning用法及代碼示例
- Python Streamlit st.image用法及代碼示例
- Python Streamlit st.markdown用法及代碼示例
注:本文由純淨天空篩選整理自streamlit.io大神的英文原創作品 st.bokeh_chart。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。