showplot <- plot_ly(data_2007, x = ~gdpPercap, y = ~lifeExp, z = ~pop,
color = ~continent,type = "scatter3d",mode="markers",size = ~size,
colors = colors,marker = list(symbol = 'circle',
sizemode = 'diameter'),sizes = 16,text = ~paste('Country:',
country, '<br>Life Expectancy:',lifeExp, '<br>GDP:',
gdpPercap,'<br>Pop.:', pop)) %>%
layout(title = 'Life Expectancy v. Per Capita GDP, 2007',
scene = list(xaxis = list(title = 'GDP per capita (2000 dollars)',
gridcolor = 'rgb(255, 255, 255)',
range = c(2.003297660701705, 5.191505530708712),type = 'log',
zerolinewidth = 1,ticklen = 5,gridwidth = 2),
yaxis = list(title = 'Life Expectancy (years)',
gridcolor = 'rgb(255, 255, 255)',
range = c(36.12621671352166, 91.72921793264332),
zerolinewidth = 1,ticklen = 5,gridwith = 2),
zaxis = list(title = 'Population',
gridcolor = 'rgb(255, 255, 255)',type = 'log',
zerolinewidth = 1,ticklen = 5,gridwith = 2)),
paper_bgcolor = 'rgb(243, 243, 243)',plot_bgcolor = 'rgb(243, 243, 243)')