如何在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曲线的温度与热流数据,以location作为分组依据,用year区分曲线颜色。
内容的提问来源于stack exchange,提问作者Maany Ramanan
相关产品推荐
相关产品推荐

