提问人:Constance Coubris 提问时间:9/1/2023 最后编辑:stefanConstance Coubris 更新时间:9/1/2023 访问量:19
几何平滑格式 x 轴
Geom smooth format x-axis
问:
我正在使用时间监控,我想使用 geom-smooth 来获得趋势曲线。
我执行了以下代码,但曲线没有出现。我想这是 x 轴的格式问题。
您知道如何获得具有几何平滑的趋势曲线吗?提前感谢您的帮助!我尝试获得具有几何平滑的趋势曲线,但它没有出现
ggplot(donnes,aes(x=Day,y=value,fill=measure))+
geom_point() +
geom_smooth(method="loess", level=0.90)+
facet_wrap(~measure,ncol=1, strip.position = "left", scales="free_y", labeller = as_labeller(c(Coelenterazine = "Coelenterazine\ncontent (ng/g)", Luciferase = "Luciferase activity\n(Mq/g.s)",LightKCl= "Luminous capabilities\nwith KCl stimulation\n(Mq/g)",LightAch="Luminous capabilities\nwith acethylcholine\n(Mq/g)")))+
geom_vline(xintercept = 9.5, linetype="dotted", color = "black", size=1)+
geom_vline(xintercept = 13.5, linetype="dotted", color = "black", size=1)+
ylab(NULL) +
labs(x="Number of days in captivity")+
scale_x_discrete(expand = c(0,.6),limits = c("D0","D30","D60","D90","D120","D150","D180","D210","D240","D247","D254","D261","D268","D298","D328","D358","D388","D418","D448","D478"),labels=c("D0","D30","D60","D90","D120","D150","D180","D210","D240","D247","D254","D261","D268","D298","D328","D358","D388","D418","D448","D478"))+
labs(caption = "Evolution of coelenterazine content from August 2021 to December 2022")+
scale_color_manual(name = NULL, values = c("green4", "red4", "grey5","grey23"))+
scale_fill_manual(values = c("Coelenterazine"="green3","Luciferase"="red2","LightKCl"="grey17","LightAch"="gray72"),
name = "Measurements",
labels = c("Coelenterazine content","Luciferase activity","Light emission with KCl","Light emission with acethylcholine"))+
theme_bw()+
theme(legend.position = "none",
panel.border = element_blank(),
strip.background = element_blank(),
strip.placement = "outside",
strip.text.x = element_blank(),
panel.grid.major = element_blank(),
panel.grid.minor = element_blank(),
axis.line = element_line(size = 0.5, linetype = "solid", colour = "black"),
axis.title.x = element_text(color = "black", size = 12,family = "Tahoma"),
axis.text.x = element_text(color="black",size=10,family = "Tahoma",angle = -40, hjust=0.1),
axis.text.y = element_text(color="black",size=10,family = "Tahoma"))
答: 暂无答案
评论