我有這樣的情節:
library(ggplot2)
ggplot()
geom_function(fun = ~ 2*-.x^2 2*.x 3)

現在我想“突出顯示”曲線的一段,如下面在 Paint 中制作的照片所示:

我怎樣才能做到這一點?
uj5u.com熱心網友回復:
您可以xlim向第二個添加一個引數geom_function
library(ggplot2)
ggplot()
geom_function(fun = ~ 2*-.x^2 2*.x 3)
geom_function(fun = ~ 2*-.x^2 2*.x 3, xlim=c(.25, .5), color = 'blue', size = 2)

由reprex 包(v2.0.0)創建于 2022-11-15
轉載請註明出處,本文鏈接:https://www.uj5u.com/gongcheng/534813.html
標籤:r图表2
上一篇:根據其他列分配新的列值
