繁体   English   中英

在 R 图形的图例中输入值

[英]Enter values ​in the legend of a graph in R

我想知道如何调整我下面的图表。我的想法是在标签之前推出,并在此附件中。

Test <- structure(list(Category = c("FDE", "FDE", "FDE", "FDE"), 
Days = c(4, 1, 6, 1),Numbers= c(7, 3, 2, 1)), row.names = c(NA, 4L), class = "data.frame")

plot(Numbers ~ Days, xlab = "Days", ylab = "Numbers", xlim= c(0,10), ylim= c(0,10), data=Test)

xy <- unique(Test$Numbers)

points(0, xy, col = "red", pch = 19, cex = 2, xpd = TRUE)

legend("bottomright",inset=c(-0,-0), legend= round(xy,1),title="The number is é:",title.col = "black", cex = 1.2)

在此处输入图片说明

在前面paste点东西就行了。

legend("bottomright", inset=c(-0, -0), 
       legend=paste('USD', round(xy, 1)),
       title="The number is é:", title.col="black", cex=.9)

在此处输入图片说明

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM