我制作了一个数据框 df 的 corrplot。不幸的是,corrplot 不适合屏幕。corrplot 的顶部丢失。我怎样才能让它适合屏幕?
我用以下代码在R中制作了一个饼图:
#make slices
slices <- c(19, 26, 55)
# Define some colors
colors <- c("yellow2","olivedrab3","orangered3")
# Calculate the percentage for each day, rounded to one decimal place
slices_labels <- round(slices/sum(slices) * 100, 1)
# Concatenate a '%' char after each value
slices_labels <- paste(slices_labels, "%", sep="")
# Create a pie chart with defined heading and custom colors and labels
pie(slices, main="Sum", col=colors, labels=slices_labels, cex=0.8)
# Create a legend at the right
legend("topright", c("DH","UT","AM"), cex=0.7, fill=colors)
Run Code Online (Sandbox Code Playgroud)
但我想在我的饼图旁边添加图例。我也曾尝试下面的代码:legend("centreright", c("DH","UT","AM"), cex=0.7, fill=colors) …