python绘制饼图标题字体大小,如何在Python中使用Plotly将饼图绘制为具有自定义大小的子图...

本文讨论了如何在Python的Plotly库中创建具有自定义大小的饼图子图。当尝试将scatter plots替换为pie charts时遇到了问题,因为pie charts没有x和y轴。解决方案是通过指定每个饼图的domain来实现布局。代码示例展示了如何使用Plotly的Pie对象和domains创建六角形网格的饼图子图。
摘要由CSDN通过智能技术生成

I've been trying to make a grid of subplots with custom size with Plotly(version 1.12.9) in Jupyter notebook(offline). There is nice examples in the Plotly website but all of them are with scattered plots. I modified one of them to make it look like the one I want to and it works with scatter plots:

import plotly

import plotly.offline as py

import plotly.graph_objs as go

py.init_notebook_mode(connected=True)

labels = ['Oxygen','Hydrogen','Carbon_Dioxide','Nitrogen']

values = [4500,2500,1053,500]

trace0 = go.Scatter(x=[1, 2], y=[1, 2])

trace1 = go.Scatter(x=[1, 2], y=[1, 2])

trace2 = go.Scatter(x=[1, 2], y=[1, 2])

trace3 = go.Scatter(x=[1, 2], y=[1, 2])

trace4 = go.Scatter(x=[1, 2], y=[1, 2])

tr

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值