小编use*_*269的帖子

我的 corrplot 不适合屏幕?

我制作了一个数据框 df 的 corrplot。不幸的是,corrplot 不适合屏幕。corrplot 的顶部丢失。我怎样才能让它适合屏幕?

r correlation r-corrplot

6
推荐指数
1
解决办法
7573
查看次数

如何在R中的饼图旁创建图例?

我用以下代码在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) …

charts r legend pie-chart

3
推荐指数
1
解决办法
7744
查看次数

标签 统计

r ×2

charts ×1

correlation ×1

legend ×1

pie-chart ×1

r-corrplot ×1