0

I want to create a 3-d bubble plot comparing 8 different industry sectors in terms of their market size (Market) in million dollars, market share (Share), growth rate (Growth), number of competitors (Competitors). The size of bubbles (sphere) is representing the market share. The percentage of market share shows the level that sphere is filled. The color of sphere indicates the variable Barrier in three colors. The x and y variables are Competitors and Growth. I want that total size of each sphere represent total market size and fill it with percentage of market share. I want to label each sphere beside it and legends indicating the size of spheres. I appreciate any help. below is a fake data.

data <- data.frame(Sectors=c("A","B","C","D","E","F","H","I"),
Market=sample(1:100, 8, replace=T),
Share=c(0.10, 0.55, 0.30, 0.80, 0.15, 0.40, 0.30, 0.05),
Growth=c(0.9, 0.05, 0.03, 0.02, 0.02, 0.04, 0.07, 0.2),
competitors=sample(1:50, 8, replace=T) )#fake data
ashkan
  • 113
  • 2
  • 8
  • Wew, you want quite a lot. ;-) Is this some sort of assignment/homework? Anyways.. What have you tried and where did you get stuck? What's z (speaking of 3D)? I think 2D works well and you should try ggplot2. – lukeA Jun 01 '17 at 15:37
  • Yes. it should be 2D. No I have no idea how to construct it. I searched and came with plot3d in rgl package for 3 dimensional but I don't know how to show the percentage of fill. There is a excel solution but still the percentage part is not addressed. – ashkan Jun 01 '17 at 15:46

1 Answers1

0
# install.packages("ggplot2")
# install.packages("ggrepel")
library(ggplot2)
ggplot(data, aes(x=competitors, y=Growth)) + 
  geom_point(aes(size=Market, color=Share)) + 
  guides(color="none") +
  ggrepel::geom_text_repel(aes(label=Sectors))
lukeA
  • 53,097
  • 5
  • 97
  • 100