plot_ly()%>% add_pie(data=perished,labels=~Class,values=~Count,
name='Count',domain = list(x = c(0.0,0.25),
y = c(0.4, 1.0)),textposition = 'inside',
textinfo = 'label+percent')%>%
add_pie(data=survived,labels=~Class,values=~Count,
name='Count',domain = list(x = c(0.6, 0.85),
y = c(0.4, 1.0)),textposition = 'inside',
textinfo = 'label+percent')%>%
layout( showlegend = FALSE,autosize=TRUE,
xaxis = list(showgrid = FALSE, zeroline = FALSE,
showticklabels = FALSE),
yaxis = list(showgrid = FALSE, zeroline = FALSE,
showticklabels = FALSE),
annotations = list(
list(x = 0.1 , y = 1.0, text = "Perished",
showarrow = F, xref='paper', yref='paper'),
list(x = 0.75 , y = 1.0, text = "Survived",
showarrow = F, xref='paper', yref='paper')))