gpt4 book ai didi

r - 如何在ggplot中指示y轴不从0开始?

转载 作者:行者123 更新时间:2023-12-05 07:10:27 25 4
gpt4 key购买 nike

<分区>

如何在我的绘图中打破不从 0 开始的 y 轴?我想这不能用ggplot来完成。还有其他解决方案吗?

我想得到这个:enter image description here

我的 ggplot:

ggplot(allEvents %>% dplyr::filter(FixationID>1,FixationID<15), aes(FixationID, Fixation)) +
geom_line(stat="summary", fun.y=mean, position="identity") + theme_bw() + stat_summary(fun.data=mean_se)+
labs (x = "Ordinal fixation number", y = "Fixation duration (s)") +
scale_y_continuous (name="Fixation duration (s) ", limits=c(0.1, 0.4)) +
scale_x_continuous (name="Ordinal fixation number", breaks=c(5,10,15,20)) +
geom_smooth(method=lm)

摘 self 的数据:

structure(list(Fixation = c(0.383, 0.185, NA, 0.312, NA, 0.328, 
NA, 0.259, NA, 0.335), FixationID = c(1, 2, NA, 3, NA, 4, NA,
5, NA, 6)), .Names = c("Fixation", "FixationID"), row.names = c(NA,
10L), class = "data.frame")

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com