我構建了圖表,但我嘗試添加圖表的名稱,但它不起作用。它應該看起來像圖片,我只有沒有名字的圖表
如果有人知道應該使用哪個功能,我會很高興
uj5u.com熱心網友回復:
geomtextpath 包看起來很適合這個用例。非常好。
library(ggplot2)
library(geomtextpath)
ggplot(data.frame(x = 0))
geom_textpath(stat = "function", fun = ~ 2.5 * .x,
label = "Holding Cost",
vjust = 1.1, colour = "green", hjust = 0.95, size = 6)
geom_textpath(stat = "function", fun = ~ 500 / .x ^0.5,
label = "Set Up Cost",
vjust = -0.1, colour = "blue", hjust = 0.95, size = 6)
geom_textpath(stat = "function", fun = ~ 500 / .x ^0.5 2.5 * .x,
label = "Total Cost",
vjust = -0.1, colour = "red", hjust = 0.95, size = 6)
xlim(1, 100)
theme_bw()

由reprex 包于 2022-03-24 創建(v2.0.1)
轉載請註明出處,本文鏈接:https://www.uj5u.com/qiye/450742.html
