簡體   English   中英

分層 plot 與 r 中的氣泡

[英]Hierarchical plot with bubbles in r

這個頁面上,我發現了一個有趣的 plot:

在此處輸入圖像描述

是否有可能做類似或完全一樣的事情? treemapggraph庫的結合)。

您可以使用voronoiTreemap package 獲得類似的外觀:

library(voronoiTreemap)

vor <- data.frame(h1 = 'World', 
                  h2 = c('Europe', 'Europe', "Europe",
                         'America', 'America', 'America', 'America',
                         'Asia', 'Asia', 'Asia', 'Asia', 'Asia', 'Asia',
                         'Africa', 'Africa', 'Africa'),
                  h3 = c("UK", "France", "Germany",
                         "USA", "Mexico", "Canada", "Brazil",
                         "China", "India", "S Korea", "Japan", "Thailand",
                         "Malaysia", "Egypt", "South Africa", "Nigeria"),
                  color = rep(c("pink", "steelblue", "#96f8A0", "yellow"),
                              times = c(3, 4, 6, 3)),
                  weight = c(12, 10, 15, 40, 5, 7, 9, 45, 30, 20, 20, 6, 9,
                             8, 10, 5),
                  codes = c("UK", "France", "Germany",
                            "USA", "Mexico", "Canada", "Brazil",
                            "China", "India", "S Korea", "Japan", "Thailand",
                            "Malaysia", "Egypt", "South Africa", "Nigeria"))

vt <- vt_input_from_df(vor)

vt_d3(vt_export_json(vt))

在此處輸入圖像描述

暫無
暫無

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

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