{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Mapbox 密度热图\n",
"\n",
"在使用 `px.density_mapbox` 时,数据帧的每一行都表示为具有给定影响半径的平滑点:"
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"import pandas as pd\n",
"import plotly.express as px\n",
"from plotly import graph_objects as go\n",
"go.FigureWidget(); # 用于初始化\n",
"df = pd.read_csv('https://raw.githubusercontent.com/plotly/datasets/master/earthquakes-23k.csv')"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
" \n",
" "
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/vnd.plotly.v1+json": {
"config": {
"plotlyServerURL": "https://plot.ly"
},
"data": [
{
"coloraxis": "coloraxis",
"hovertemplate": "Magnitude=%{z}
Latitude=%{lat}
Longitude=%{lon}