简体   繁体   中英

Hierarchical plot with bubbles in r

On this page , I found an interesting plot:

在此处输入图像描述

Is it possible to do something similar or exactly? (Combination between treemap and ggraph library).

You can get a similar appearance with the 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))

在此处输入图像描述

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM