【问题标题】:increase the size of the bubbles created by the plot_ly() where mode = "markers"增加 plot_ly() 创建的气泡的大小 where mode = "markers"
【发布时间】:2016-10-24 06:41:54
【问题描述】:
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 = list(size = Quantity2016*100)注意,您还需要添加一些数据并将您的问题格式化为一个最小的工作示例。就目前而言,它很可能被标记为删除,因为它不可重现。请阅读 thisthisread the help pages 以更好地了解如何在 SO 上提问。

标签: r plotly


【解决方案1】:

尝试在marker 下添加sizerefsizemode。特别是玩弄sizeref的不同值:

trace = go.Scatter(x=x,
                   y=y, 
                   mode='markers',
                   marker=dict(
                               size=[abs(i) for i in Quantity2016],
                               sizeref=0.1,
                               sizemode='area'
                              )
                   )

请注意, size 在你的 Quantity2016 列表中的负值会使这些点消失(或者我想被绘制为大小 0 ),所以请注意这一点。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2016-07-31
    • 1970-01-01
    • 2018-06-13
    • 2021-11-26
    • 2011-12-23
    • 1970-01-01
    • 1970-01-01
    • 2019-04-22
    相关资源
    最近更新 更多