plotly可视化绘制混合图
Posted Data+Science+Insight
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了plotly可视化绘制混合图相关的知识,希望对你有一定的参考价值。
plotly可视化绘制混合图
# 混合图多种可视化形式融合在一个图形中;
from plotly.graph_objs import *
import plotly as py
import plotly.graph_objs as go
pyplt = py.offline.plot
import pandas as pd
# read in volcano database data
df = pd.read_excel(r\'volcano_db.xlsx\')
# frequency of Country
freq = df
freq = freq.Country.value_counts().reset_index().rename(columns={\'index\': \'x\'})
# plot(1) top 10 countries by total volcanoes
locations = go.Bar(x=freq[\'x\'][0:10],y=freq[\'Country\'][0:10], marker=dict(color=\'#CF1020\'))
# read in 3d volcano surface data
df_v = pd.read_excel(r\'volcano.xlsx\')
# plot(2) 3d surface of volcano
threed = Surface(z=df_v.values.tolist(), colorscale=\'Reds\', showscale=False)
# plot(3) scattergeo map of volcano locations
trace3 = {
"geo": "geo3",
"lon": df[\'Longitude\'],
"lat":
以上是关于plotly可视化绘制混合图的主要内容,如果未能解决你的问题,请参考以下文章