簡體   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