geom_function中的像素化不平滑曲线

问题描述

如何使用ggplot2平滑图表线

我正在为此功能绘制图形

exposure_funct_0.25 <- function(x) {
  exp(-0.25*x)
} 

exposure_funct_0.5 <- function(x) {
  exp(-0.5*x)
} 

 ggplot(data.frame(x = c(0,15)),aes(x=x)) + 
         geom_function( fun = exposure_funct_0.25,linetype = 2 )  + 
        geom_function(fun = exposure_funct_0.5,linetype = 1)

但是,代码产生了这样的“折线”图表:

enter image description here

我尝试添加+geom_smooth(),但是这个似乎与我的情况不符。不幸的是,指定n = 201或更高值无济于事。

有什么办法可以使线条平滑吗?

smoothened line

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)