0

I used the following code to plot a packing circle graph and I want to add the numbers (values) for each bubble in addition to the text. How do I do that? Another question is whether someone knows how to deal with a large number of categories (about 200) which makes some of the plot unreadable. Is there another visualization that might be more useful in this case?

Thanks in advance!

library(packcircles)
library(ggplot2)
library(viridis)
library(ggiraph)
packing <- circleProgressiveLayout(data$Number, sizetype='area') 
data <- cbind(data, packing) 
dat.gg <- circleLayoutVertices(packing, npoints=50) 
ggplot() + 
    geom_polygon(data = dat.gg, aes(x, y, fill=as.factor(id), colour = "black", alpha = 0.6)) +
  geom_text(data = data, aes(x, y, size=Number, label = Journal)) +
  scale_size_continuous(range = c(2,4)) +
  theme_void() + 
  theme(legend.position="none")+
  coord_equal()```
AmitKai
  • 11
  • 4
  • please post a [minimal reproducible example](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) to work with – Elia Sep 27 '21 at 14:09
  • '''packing <- circleProgressiveLayout(data$Number, sizetype='area') data <- cbind(data, packing) dat.gg <- circleLayoutVertices(packing, npoints=50) ggplot() + geom_polygon(data = dat.gg, aes(x, y, fill=as.factor(id), colour = "black", alpha = 0.6)) + geom_text(data = data, aes(x, y, size=Number, label = Journal)) + scale_size_continuous(range = c(2,4)) + theme_void() + theme(legend.position="none")+ coord_equal()``` – AmitKai Sep 27 '21 at 14:45
  • Hi - i'm not sure how to produce a date set that would fit similar to my data but I hope this help (see above) – AmitKai Sep 27 '21 at 14:45
  • just edit your question including the library you use to run the code and the output of `dput(data)` – Elia Sep 27 '21 at 14:47
  • done (without the data) – AmitKai Sep 27 '21 at 15:47

0 Answers0