diff --git a/src/ScatterplotPlugin.cpp b/src/ScatterplotPlugin.cpp index 0dad5b7..e66af4a 100644 --- a/src/ScatterplotPlugin.cpp +++ b/src/ScatterplotPlugin.cpp @@ -603,8 +603,10 @@ void ScatterplotPlugin::loadColors(const Dataset& clusters) { for (size_t i = 0; i < static_cast(clusterVec.size()); i++) { - const auto color = clusterVec[i].getColor(); - localColors[i] = Vector3f(color.redF(), color.greenF(), color.blueF()); + const auto& cluster = clusterVec[i]; + const auto color = cluster.getColor(); + + localColors[cluster.getIndices()[0]] = Vector3f(color.redF(), color.greenF(), color.blueF()); } }