You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何在R的ggplot中平滑曲线?geom_smooth生成拟合曲线非所需

ggplot中geom_smooth生成拟合曲线而非预期平滑曲线的问题

我尝试在ggplot中对DSC曲线进行平滑处理,但使用geom_smooth()后得到的是拟合曲线,而非预期的平滑曲线。

我的代码如下:

# 加载csv文件
dataset_edited = read.csv("dsccurves.csv", header = TRUE)
str(dataset_edited)

# 绘制所有DSC曲线
plt_dsc_1 = ggplot(dataset_edited, aes(x=gt, y=enthalpy, group = location, color = year)) +
 geom_point(size=0.25)+
 scale_x_continuous("Temperature (degree C)",limits = c(50,75), breaks = seq(50,75,1))+
 scale_y_continuous("Heat flow (W/g)",limits = c(-0.37,-0.18), breaks = 
 seq(-0.37,-0.18,0.02))+
 theme_classic()+
 labs(title = "A")+
 guides(guide_legend(title = "Year"))+ 
 theme(text = element_text(size=15))
plt_dsc_1

当前生成的图像:
当前生成的DSC散点图

数据文件包含多组DSC曲线的温度与热流数据,以location作为分组依据,用year区分曲线颜色。

内容的提问来源于stack exchange,提问作者Maany Ramanan

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.20 03:25:47