簡體   English   中英

Plotly 標記尺寸

[英]Plotly marker size

我無法讓 plotly 標記大小正常工作。

test <- data.frame(a = c(1,2,3,5,3,4,2,6,4,5),
                   b = c(12,14,11,10,3,7,5,8,15,2),
                   c = c("d","e","d","f","e","d","f","e","e","f"),
                   d = c(5,5,10,15,10,15,5,10,5,15))
plot_ly()%>%
add_trace(data = test, x = ~a, y = ~b, mode = 'markers', type = 'scatter',
          color = ~c, colors = c("red", "blue", "green"),
          marker = list(size = ~d), text = ~d, hoverinfo = 'text')

我添加了一個文本框,其中包含應該用作標記大小的列,並且它可以正常工作,因此對於大小出現問題的任何幫助將不勝感激。

希望這會有所幫助,其中大小由d定義:

test <- data.frame(a = c(1,2,3,5,3,4,2,6,4,5),
                   b = c(12,14,11,10,3,7,5,8,15,2),
                   c = c("d","e","d","f","e","d","f","e","e","f"),
                   d = c(5,5,10,15,10,15,5,10,5,15))
plot_ly()%>%
  add_trace(data = test, x = ~a, y = ~b, mode = 'markers', type = 'scatter',
            color = ~c, colors = c("red", "blue", "green"),
            size = ~d, text = ~d, hoverinfo = 'text')

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM