简体   繁体   中英

Enter values ​in the legend of a graph in R

I would like to know how I can adjust my chart below.My idea is to be launched before the label, and in the Annex hereto.

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)

在此处输入图片说明

Just paste something in front.

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

在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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