{ plot(DTL, col = "#DFDFDF", border = "#FFFFFF") pieNumber = length(DF$id_hochschule) col.tab <- nv(rgb(153, 204, 255, 140, max = 255), "Anzahl Promotionen") sizeVec = DF$promotionen pMin = min(sizeVec) pMax = max(sizeVec) DF = transform(DF, promNorm = ((as.numeric(DF$promotionen) - pMin)/(pMax - pMin)) * 2 + 1) DF = transform(DF, labelposx = as.numeric(DF$x)) DF = transform(DF, labelposy = as.numeric(DF$y)) for (i in seq(1, length(DF$labelpos))) { DF$labelposx[i] = DF$x[i] + DF$promNorm[i] * sizemultiplicator + 1000 DF$labelposy[i] = DF$y[i] if (DF$labelpos[i] == "180") { DF$labelposx[i] = DF$x[i] DF$labelposy[i] = DF$y[i] - DF$promNorm[i] * sizemultiplicator - 5000 } if (DF$labelpos[i] == "270") { DF$labelposx[i] = DF$x[i] - DF$promNorm[i] * sizemultiplicator - 1000 DF$labelposy[i] = DF$y[i] } if (DF$labelpos[i] == "360") { DF$labelposx[i] = DF$x[i] DF$labelposy[i] = DF$y[i] + DF$promNorm[i] * sizemultiplicator + 5000 } } par(new = TRUE) for (i in seq(1, length(DF$labelpos))) { categoryCount = c(as.integer(DF[i, seq(4, 9)])) par(lwd = 0.3) add.pie(z = categoryCount, x = DF$x[i], y = DF$y[i], col = colVec, radius = DF$promNorm[i] * sizemultiplicator, border = "#FFFFFF", labels = NA) if (is.na(DF$labelalignment[i])) { text(DF$labelposx[i], DF$labelposy[i], labels = DF$hochschule[i], cex = 0.25, col = "#454545") } else { text(DF$labelposx[i], DF$labelposy[i], labels = DF$hochschule[i], cex = 0.25, adj = DF$labelalignment[i], col = "#454545") } } legend(4582147, 5566042, legend = c(faecherBezeichnung$bez), cex = 0.3, box.col = "#AAAAAA", fill = colVec) }