显示交互式散景图。
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。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。