增加由 plot_ly() where mode = "markers" 创建的气泡的大小
increase the size of the bubbles created by the plot_ly() where mode = "markers"
plot_ly(ProdSummary, x = logMetricRevenue2016, y = MarginPercent2016,
mode = "markers" , axes=F , size = (Quantity2016), color=Brand, text=paste("P_Code",product_code))
生成的气泡图显示小气泡,我可以这样做 size=Quantity2016*100
,但这不会增加图表上气泡的大小。都是相对的。
尝试在 marker
下添加 sizeref
和 sizemode
。特别是玩弄 sizeref
:
的不同值
trace = go.Scatter(x=x,
y=y,
mode='markers',
marker=dict(
size=[abs(i) for i in Quantity2016],
sizeref=0.1,
sizemode='area'
)
)
请注意,您的Quantity2016
列表中size
的负值将使那些点消失(或者我想被绘制为大小 0),所以请注意这一点。
plot_ly(ProdSummary, x = logMetricRevenue2016, y = MarginPercent2016,
mode = "markers" , axes=F , size = (Quantity2016), color=Brand, text=paste("P_Code",product_code))
生成的气泡图显示小气泡,我可以这样做 size=Quantity2016*100
,但这不会增加图表上气泡的大小。都是相对的。
尝试在 marker
下添加 sizeref
和 sizemode
。特别是玩弄 sizeref
:
trace = go.Scatter(x=x,
y=y,
mode='markers',
marker=dict(
size=[abs(i) for i in Quantity2016],
sizeref=0.1,
sizemode='area'
)
)
请注意,您的Quantity2016
列表中size
的负值将使那些点消失(或者我想被绘制为大小 0),所以请注意这一点。