Ind$Gentrification[which(Ind$Gentrification == 1)] <- 'Frühe Pionierphase' Ind$Gentrification[which(Ind$Gentrification == 2)] <- 'Pionier- bis Gentrifierphase' Ind$Gentrification[which(Ind$Gentrification == 3)] <- 'Gentrifierphase bis Super Gentrification' Ind$Gentrification[which(Ind$Gentrification == "NA")] <- 'Keine Gentrifizierung' Ind$Gentrification[which(Ind$Gentrification == "Mitte")] <- 'Hamburger Durchschnitt' Ind$Gentrification <- as.factor(Ind$Gentrification) colors <- c('#4AC6B7',"#965F8A", 'purple', '#1972A4', '#FF7070' ) p <- plot_ly(Ind, x = ~SI, y = ~MI, z = ~WI, color = ~Gentrification, colors = colors, marker = list(symbol = 'circle', sizemode = 'diameter'), sizes = c(5, 150), text = ~paste("Stadtteil:",id )) %>% layout(title = "Indexwerte und Gentrifizierungsphasen", paper_bgcolor = "rgb(243, 243, 243)" ) %>% add_markers() %>% layout(scene = list(xaxis = list(title = 'SozialIndex'), yaxis = list(title = 'MobilitätsIndex'), zaxis = list(title = 'WohnungsmarktIndex')))