顯示帶有點的Map。
這是 st.pydeck_chart 的包裝器,用於在Map頂部快速創建散點圖,使用 auto-centering 和 auto-zoom。
使用此命令時,我們建議所有用戶使用個人 Mapbox 令牌。這可確保此圖表中使用的Map圖塊更加穩健。您可以使用 mapbox.token 配置選項來執行此操作。
要為自己獲取令牌,請在以下位置創建一個帳戶https://mapbox.com.免費! (適用於中等使用水平)。有關如何設置配置選項的更多信息,請參閱https://docs.streamlit.io/library/advanced-features/configuration#set-configuration-options
函數簽名
st.map(data=None, zoom=None, use_container_width=True)
參數 | 說明 |
---|---|
data (pandas.DataFrame, pandas.Styler, numpy.ndarray, Iterable, dict,) | 或 None 要繪製的數據。必須有名為 'lat', 'lon', 'latitude' 或 'longitude' 的列。 |
zoom (int) |
示例
import streamlit as st
import pandas as pd
import numpy as np
df = pd.DataFrame(
np.random.randn(1000, 2) / [50, 50] + [37.76, -122.4],
columns=['lat', 'lon'])
st.map(df)
相關用法
- Python Streamlit st.markdown用法及代碼示例
- Python Streamlit st.metric用法及代碼示例
- Python Streamlit st.multiselect用法及代碼示例
- Python Streamlit st.experimental_singleton.clear用法及代碼示例
- Python Streamlit st.bokeh_chart用法及代碼示例
- 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.bar_chart用法及代碼示例
- Python Streamlit st.code用法及代碼示例
- Python Streamlit st.experimental_memo.clear用法及代碼示例
- Python Streamlit st.warning用法及代碼示例
注:本文由純淨天空篩選整理自streamlit.io大神的英文原創作品 st.map。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。