r ggplot多个缩放线

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了r ggplot多个缩放线相关的知识,希望对你有一定的参考价值。


# from KTI SOW 1
# by Andy L

# common plot components
theme_set(theme_bw())
my_facet <- facet_wrap(c("heatNumber"), scales = "free")

###########################

p_avgNSmf <- strand2_bg %>%  
  filter(
    heatNumber %in% c(
      "20505530",
      "20506890",
      "20505540",
      "20506260",
      "20505570",
      "20506270"
    )
  ) %>% 
  ggplot() +
  
  geom_line(aes(y = as.vector(scale(cc_avgNSmf)), x = datetime), 
            color = "lightgrey") +

  geom_line(aes(y = as.vector(scale(cc_loess_avgNSmf)), x = datetime),
            color =  "coral") +

  geom_line(aes(y = as.vector(scale(cc_loessdiff_avgNSmf)), x = datetime), 
            color =  "darkblue") +
  
  geom_hline(yintercept = 0) +

  my_facet +
  
  labs(title = "Average Negative Strip Mold Friction per Effective Area of Mold",
       subtitle = "with loess smoothing and slope")

以上是关于r ggplot多个缩放线的主要内容,如果未能解决你的问题,请参考以下文章

如何在ggplot2中分别缩放线和点的大小

r 缩放轴ggplot

r 在ggplot中缩放x连续

R可视化ggplot2中绘制趋势线

在 R 中的折线图中添加误差线(ggplot)

R可视化删除ggplot2图中的网格线(Gridlines)