我似乎无法遮蔽曲线下的区域,geom_ribbon
似乎已经遮蔽了正确的区域,但我想将阴影区域放在曲线下方,这样当 y 值高于 120 时,曲线下的区域黄色阴影,当 y 值高于 130 时,曲线下方区域为橙色阴影,当 y 值高于 140 时,曲线下方区域为红色阴影。我怀疑这与geom_line
论点有关。我花了几天时间思考解决方案,并尝试了许多其他解决方案,但无济于事。这是我正在使用的数据框的片段
structure(list(meal_type = structure(c(1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 2L,
2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L,
2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L,
2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L,
2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L,
2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L,
2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 4L, 4L, 4L, 4L, 4L, 4L,
4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L,
4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L,
4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L,
4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L,
4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L,
4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L), .Label = c("WO", "HF", "HP",
"LGI"), class = "factor"), subject = c(35, 35, 35, 35, 35, 35,
35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
35, 35, 35, 35, 35, 35, 35, 35, 35), timestamp = structure(c(1617754260,
1617755160, 1617756060, 1617756960, 1617757860, 1617758760, 1617759660,
1617760560, 1617761460, 1617762360, 1617763260, 1617764160, 1617765060,
1617765960, 1617766860, 1617767760, 1617768660, 1617769560, 1617770460,
1617771360, 1617772260, 1617773160, 1617774060, 1617774960, 1617775860,
1617776760, 1617777660, 1617778560, 1617779460, 1617780360, 1617781260,
1617782160, 1617783060, 1617783960, 1617784860, 1617785760, 1617786660,
1617787560, 1617788460, 1617789360, 1617790260, 1617791160, 1617792060,
1617792960, 1617793860, 1617794760, 1617795660, 1617796560, 1617797460,
1617798360, 1617799260, 1617800160, 1617801060, 1617801960, 1617802860,
1617803760, 1617804660, 1617805560, 1617806460, 1617807360, 1617808260,
1617809160, 1617810060, 1617810960, 1617811860, 1617812760, 1617813660,
1617814560, 1617815460, 1617816360, 1617817260, 1617818160, 1617819060,
1617819960, 1617820860, 1617821760, 1617822660, 1617823560, 1617824460,
1617825360, 1617826260, 1617827160, 1617828060, 1617828960, 1617829860,
1617830760, 1617831660, 1617832560, 1617833460, 1617834360, 1617835260,
1617836160, 1617837060, 1617837960, 1617838860, 1617839760, 1617840660,
1617841560, 1617842460, 1617843360, 1617844260, 1617845160, 1617846060,
1617846960, 1617847860, 1617848760, 1617849660, 1617850560, 1617851460,
1617852360, 1617853260, 1617854160, 1617855060, 1617855960, 1617856860,
1617857760, 1617858660, 1617859560, 1617860460, 1617861360, 1617862260,
1617863160, 1617864060, 1617864960, 1617865860, 1617866760, 1617867660,
1617868560, 1617869460, 1617870360, 1617871260, 1617872160, 1617873060,
1617873960, 1617874860, 1617875760, 1617876660, 1617877560, 1617878460,
1617879360, 1617880260, 1617881160, 1617882060, 1617882960, 1617883860,
1617884760, 1617885660, 1617886560, 1617887460, 1617888360, 1617889260,
1617890160, 1617891060, 1617891960, 1617892860, 1617893760, 1617894660,
1617895560, 1617896460, 1617897360, 1617898260, 1617899160, 1617900060,
1617900960, 1617901860, 1617902760, 1617903660, 1617904560, 1617905460,
1617906360, 1617907260, 1617908160, 1617909060, 1617909960, 1617910860,
1617911760, 1617912660, 1617913560, 1617914460, 1617915360, 1617916260,
1617917160, 1617918060, 1617918960, 1617919860, 1617920760, 1617921660,
1617922560, 1617923460, 1617924360, 1617925260, 1617926160, 1617927060,
1617927960, 1617928860, 1617929760, 1617930660, 1617931560, 1617932460,
1617933360, 1617934260, 1617935160, 1617936060, 1617936960, 1617937860,
1617938760, 1617939660, 1617940560, 1617941460, 1617942360, 1617943260,
1617944160, 1617945060, 1617945960, 1617946860, 1617947760, 1617948660,
1617949560, 1617950460, 1617951360, 1617952260, 1617953160, 1617954060,
1617954960, 1617955860, 1617956760, 1617957660, 1617958560, 1617959460,
1617960360, 1617961260, 1617962160, 1617963060, 1617963960, 1617964860,
1617965760, 1617966660, 1617967560, 1617968460, 1617969360, 1617970260,
1617971160, 1617972060, 1617972960, 1617973860, 1617974760, 1617975660,
1617976560, 1617977460, 1617978360, 1617979260, 1617980160, 1617981060,
1617981960, 1617982860, 1617983760, 1617984660, 1617985560, 1617986460,
1617987360, 1617988260, 1617989160, 1617990060, 1617990960, 1617991860,
1617992760, 1617993660, 1617994560, 1617995460, 1617996360, 1617997260,
1617998160, 1617999060, 1617999960, 1618000860, 1618001760, 1618002660,
1618003560, 1618004460, 1618005360, 1618006260, 1618007160, 1618008060,
1618008960, 1618009860, 1618010760, 1618011660, 1618012560, 1618013460,
1618014360, 1618015260, 1618016160, 1618017060, 1618017960, 1618018860,
1618019760, 1618020660, 1618021560, 1618022460, 1618023360, 1618024260,
1618025160, 1618026060, 1618026960, 1618027860, 1618028760, 1618029660,
1618030560, 1618031460, 1618032360, 1618033260, 1618034160, 1618035060,
1618035960, 1618036860, 1618037760, 1618038660, 1618039560, 1618040460,
1618041360, 1618042260, 1618043160, 1618044060, 1618044960, 1618045860,
1618046760, 1618047660, 1618048560, 1618049460, 1618050360, 1618051260,
1618052160, 1618053060, 1618053960, 1618054860, 1618055760, 1618056660,
1618057560, 1618058460, 1618059360, 1618060260, 1618061160, 1618062060,
1618062960, 1618063860, 1618064760, 1618065660, 1618066560, 1618067460,
1618068360, 1618069260, 1618070160, 1618071060, 1618071960, 1618072860,
1618073760, 1618074660, 1618075560, 1618076460, 1618077360, 1618078260,
1618079160, 1618080060, 1618080960, 1618081860, 1618082760, 1618083660,
1618084560, 1618085460, 1618086360, 1618087260, 1618088160, 1618089060,
1618089960, 1618090860, 1618091760, 1618092660, 1618093560, 1618094460,
1618095360, 1618096260, 1618097160, 1618098060), tzone = "UTC", class = c("POSIXct",
"POSIXt")), sensorglucose = c(76, 77, 77, 82, 88, 90, 89, 86,
83, 80, 78, 78, 81, 81, 82, 82, 81, 79, 78, 77, 77, 76, 73, 71,
76, 79, 73, 70, 70, 73, 75, 69, 64, 66, 67, 63, 64, 69, 73, 68,
66, 70, 92, 104, 93, 80, 68, 76, 97, 91, 76, 71, 72, 76, 81,
95, 111, 108, 91, 85, 80, 78, 86, 94, 89, 87, 89, 85, 79, 76,
82, 103, 114, 102, 88, 85, 83, 85, 87, 82, 82, 80, 76, 84, 98,
98, 87, 102, 132, 130, 116, 107, 104, 99, 85, 77, 73, 70, 76,
80, 74, 72, 73, 76, 76, 66, 65, 71, 74, 71, 73, 76, 76, 74, 73,
73, 76, 80, 78, 75, 75, 73, 69, 69, 70, 68, 71, 75, 75, 73, 72,
70, 74, 89, 107, 104, 88, 80, 80, 81, 76, 70, 79, 97, 95, 80,
80, 91, 103, 100, 89, 90, 99, 102, 93, 81, 83, 94, 103, 100,
89, 91, 101, 106, 96, 79, 69, 77, 90, 82, 75, 74, 78, 84, 85,
89, 87, 81, 80, 85, 93, 86, 71, 71, 81, 82, 83, 96, 91, 79, 91,
92, 92, 92, 78, 83, 88, 76, 80, 92, 90, 81, 77, 78, 80, 80, 79,
78, 76, 70, 72, 77, 75, 67, 67, 70, 70, 70, 67, 61, 62, 65, 68,
72, 72, 72, 71, 66, 65, 68, 70, 72, 73, 71, 69, 71, 69, 64, 72,
89, 97, 89, 78, 65, 61, 69, 82, 89, 83, 77, 80, 81, 81, 88, 87,
78, 83, 104, 117, 119, 118, 114, 111, 110, 105, 99, 95, 92, 89,
83, 84, 101, 118, 111, 108, 113, 111, 109, 105, 94, 89, 86, 77,
85, 109, 103, 73, 72, 93, 97, 92, 84, 65, 61, 89, 100, 81, 70,
68, 71, 85, 99, 106, 103, 91, 90, 90, 76, 66, 62, 70, 83, 81,
74, 74, 73, 69, 71, 76, 74, 80, 104, 117, 101, 81, 78, 82, 81,
78, 76, 80, 90, 92, 82, 78, 80, 79, 80, 81, 79, 81, 83, 81, 78,
77, 80, 92, 97, 86, 93, 104, 102, 101, 102, 90, 84, 85, 102,
118, 97, 72, 63, 64, 73, 77, 77, 79, 79, 75, 85, 119, 144, 137,
115, 100, 92, 91, 91, 87, 102, 102, 87, 91), day_extract = c("07",
"07", "07", "07", "07", "07", "07", "07", "07", "07", "07", "07",
"07", "07", "07", "07", "07", "07", "07", "07", "07", "07", "07",
"07", "07", "07", "07", "07", "07", "07", "07", "07", "07", "07",
"07", "07", "07", "07", "07", "07", "07", "07", "07", "07", "07",
"07", "07", "07", "07", "07", "07", "07", "07", "07", "07", "07",
"07", "07", "07", "07", "07", "07", "07", "07", "07", "07", "07",
"07", "07", "07", "07", "07", "07", "07", "07", "07", "07", "07",
"07", "07", "07", "07", "07", "07", "07", "07", "07", "07", "07",
"07", "07", "07", "07", "07", "07", "07", "08", "08", "08", "08",
"08", "08", "08", "08", "08", "08", "08", "08", "08", "08", "08",
"08", "08", "08", "08", "08", "08", "08", "08", "08", "08", "08",
"08", "08", "08", "08", "08", "08", "08", "08", "08", "08", "08",
"08", "08", "08", "08", "08", "08", "08", "08", "08", "08", "08",
"08", "08", "08", "08", "08", "08", "08", "08", "08", "08", "08",
"08", "08", "08", "08", "08", "08", "08", "08", "08", "08", "08",
"08", "08", "08", "08", "08", "08", "08", "08", "08", "08", "08",
"08", "08", "08", "08", "08", "08", "08", "08", "08", "08", "08",
"08", "08", "08", "08", "09", "09", "09", "09", "09", "09", "09",
"09", "09", "09", "09", "09", "09", "09", "09", "09", "09", "09",
"09", "09", "09", "09", "09", "09", "09", "09", "09", "09", "09",
"09", "09", "09", "09", "09", "09", "09", "09", "09", "09", "09",
"09", "09", "09", "09", "09", "09", "09", "09", "09", "09", "09",
"09", "09", "09", "09", "09", "09", "09", "09", "09", "09", "09",
"09", "09", "09", "09", "09", "09", "09", "09", "09", "09", "09",
"09", "09", "09", "09", "09", "09", "09", "09", "09", "09", "09",
"09", "09", "09", "09", "09", "09", "09", "09", "09", "09", "09",
"09", "10", "10", "10", "10", "10", "10", "10", "10", "10", "10",
"10", "10", "10", "10", "10", "10", "10", "10", "10", "10", "10",
"10", "10", "10", "10", "10", "10", "10", "10", "10", "10", "10",
"10", "10", "10", "10", "10", "10", "10", "10", "10", "10", "10",
"10", "10", "10", "10", "10", "10", "10", "10", "10", "10", "10",
"10", "10", "10", "10", "10", "10", "10", "10", "10", "10", "10",
"10", "10", "10", "10", "10", "10", "10", "10", "10", "10", "10",
"10", "10", "10", "10", "10", "10", "10", "10", "10", "10", "10",
"10", "10", "10", "10", "10", "10", "10", "10"), change = c(-5,
-4, -4, 1, 7, 9, 8, 5, 2, -1, -3, -3, 0, 0, 1, 1, 0, -2, -3,
-4, -4, -5, -8, -10, -5, -2, -8, -11, -11, -8, -6, -12, -17,
-15, -14, -18, -17, -12, -8, -13, -15, -11, 11, 23, 12, -1, -13,
-5, 16, 10, -5, -10, -9, -5, 0, 14, 30, 27, 10, 4, -1, -3, 5,
13, 8, 6, 8, 4, -2, -5, 1, 22, 33, 21, 7, 4, 2, 4, 6, 1, 1, -1,
-5, 3, 17, 17, 6, 21, 51, 49, 35, 26, 23, 18, 4, -4, -1, -4,
2, 6, 0, -2, -1, 2, 2, -8, -9, -3, 0, -3, -1, 2, 2, 0, -1, -1,
2, 6, 4, 1, 1, -1, -5, -5, -4, -6, -3, 1, 1, -1, -2, -4, 0, 15,
33, 30, 14, 6, 6, 7, 2, -4, 5, 23, 21, 6, 6, 17, 29, 26, 15,
16, 25, 28, 19, 7, 9, 20, 29, 26, 15, 17, 27, 32, 22, 5, -5,
3, 16, 8, 1, 0, 4, 10, 11, 15, 13, 7, 6, 11, 19, 12, -3, -3,
7, 8, 9, 22, 17, 5, 17, 18, 12, 12, -2, 3, 8, -4, 0, 12, 10,
1, -3, -2, 0, 0, -1, -2, -4, -10, -8, -3, -5, -13, -13, -10,
-10, -10, -13, -19, -18, -15, -12, -8, -8, -8, -9, -14, -15,
-12, -10, -8, -7, -9, -11, -9, -11, -16, -8, 9, 17, 9, -2, -15,
-19, -11, 2, 9, 3, -3, 0, 1, 1, 8, 7, -2, 3, 24, 37, 39, 38,
34, 31, 30, 25, 19, 15, 12, 9, 3, 4, 21, 38, 31, 28, 33, 31,
29, 25, 14, 9, 6, -3, 5, 29, 23, -7, -8, 8, 12, 7, -1, -20, -24,
4, 15, -4, -15, -17, -14, 0, 14, 21, 18, 6, 5, 5, -9, -19, -23,
-15, -2, -4, -11, -11, -12, -16, -14, -9, -11, -5, 19, 32, 16,
-4, -7, -3, -4, -7, -9, -5, 5, 7, -3, -7, -5, -6, -5, -4, -6,
-4, -2, -4, -7, -8, -5, 7, 12, 1, 8, 19, 17, 16, 17, 5, -1, 0,
17, 33, 12, -13, -22, -21, -12, -8, -8, -6, -6, -10, 0, 34, 59,
52, 30, 15, 7, 6, 6, 2, 17, 17, 2, 6), diff = c(1, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
), iauc = c(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 64, 225, 105, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2.30769230769231, 45, 52.5,
16.875, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3.97058823529412, 9.64285714285714,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 172.8, 307.5, 98.5227272727273,
0, 0, 0, 0, 0, 0, 0, 0, 0), class = c("normal", "normal", "normal",
"normal", "normal", "normal", "normal", "normal", "normal", "normal",
"normal", "normal", "normal", "normal", "normal", "normal", "normal",
"normal", "normal", "normal", "normal", "normal", "normal", "normal",
"normal", "normal", "normal", "normal", "normal", "normal", "normal",
"normal", "normal", "normal", "normal", "normal", "normal", "normal",
"normal", "normal", "normal", "normal", "normal", "normal", "normal",
"normal", "normal", "normal", "normal", "normal", "normal", "normal",
"normal", "normal", "normal", "normal", "normal", "normal", "normal",
"normal", "normal", "normal", "normal", "normal", "normal", "normal",
"normal", "normal", "normal", "normal", "normal", "normal", "normal",
"normal", "normal", "normal", "normal", "normal", "normal", "normal",
"normal", "normal", "normal", "normal", "normal", "normal", "normal",
"normal", "hyper-2", "normal", "normal", "normal", "normal",
"normal", "normal", "normal", "normal", "normal", "normal", "normal",
"normal", "normal", "normal", "normal", "normal", "normal", "normal",
"normal", "normal", "normal", "normal", "normal", "normal", "normal",
"normal", "normal", "normal", "normal", "normal", "normal", "normal",
"normal", "normal", "normal", "normal", "normal", "normal", "normal",
"normal", "normal", "normal", "normal", "normal", "normal", "normal",
"normal", "normal", "normal", "normal", "normal", "normal", "normal",
"normal", "normal", "normal", "normal", "normal", "normal", "normal",
"normal", "normal", "normal", "normal", "normal", "normal", "normal",
"normal", "normal", "normal", "normal", "normal", "normal", "normal",
"normal", "normal", "normal", "normal", "normal", "normal", "normal",
"normal", "normal", "normal", "normal", "normal", "normal", "normal",
"normal", "normal", "normal", "normal", "normal", "normal", "normal",
"normal", "normal", "normal", "normal", "normal", "normal", "normal",
"normal", "normal", "normal", "normal", "normal", "normal", "normal",
"normal", "normal", "normal", "normal", "normal", "normal", "normal",
"normal", "normal", "normal", "normal", "normal", "normal", "normal",
"normal", "normal", "normal", "normal", "normal", "normal", "normal",
"normal", "normal", "normal", "normal", "normal", "normal", "normal",
"normal", "normal", "normal", "normal", "normal", "normal", "normal",
"normal", "normal", "normal", "normal", "normal", "normal", "normal",
"normal", "normal", "normal", "normal", "normal", "normal", "normal",
"normal", "normal", "normal", "normal", "normal", "normal", "normal",
"normal", "normal", "normal", "normal", "normal", "normal", "normal",
"normal", "normal", "normal", "normal", "normal", "normal", "normal",
"normal", "normal", "normal", "normal", "normal", "normal", "normal",
"normal", "normal", "normal", "normal", "normal", "normal", "normal",
"normal", "normal", "normal", "normal", "normal", "normal", "normal",
"normal", "normal", "normal", "normal", "normal", "normal", "normal",
"normal", "normal", "normal", "normal", "normal", "normal", "normal",
"normal", "normal", "normal", "normal", "normal", "normal", "normal",
"normal", "normal", "normal", "normal", "normal", "normal", "normal",
"normal", "normal", "normal", "normal", "normal", "normal", "normal",
"normal", "normal", "normal", "normal", "normal", "normal", "normal",
"normal", "normal", "normal", "normal", "normal", "normal", "normal",
"normal", "normal", "normal", "normal", "normal", "normal", "normal",
"normal", "normal", "normal", "normal", "normal", "normal", "normal",
"normal", "normal", "normal", "normal", "normal", "normal", "normal",
"normal", "normal", "normal", "normal", "normal", "normal", "normal",
"normal", "normal", "normal", "normal", "normal", "hyper-3",
"hyper-2", "normal", "normal", "normal", "normal", "normal",
"normal", "normal", "normal", "normal", "normal")), row.names = c(NA,
-383L), class = c("data.table", "data.frame"), .internal.selfref = <pointer: 0x000002244b801ef0>)
以及我到目前为止所尝试的
figure1 = ggplot(variableh, aes(x = timestamp, y = sensorglucose)) +
geom_line(aes(color = meal_type, group = 1)) + #geom_ribbon(aes(timestamp, ymin = 120, ymax = 140), fill = "pink", alpha = 0.5) +
geom_ribbon(data = variableh[variableh$class == "hyper-1",], aes(timestamp,y=sensorglucose, ymin = 120, ymax = sensorglucose), fill = "yellow", alpha = 0.5) +
geom_ribbon(data = variableh[variableh$class == "hyper-2",], aes(timestamp, y=sensorglucose, ymin = 130, ymax = sensorglucose), fill = "orange", alpha = 0.5) +
geom_ribbon(data = variableh[variableh$class == "hyper-3",], aes(timestamp, y=sensorglucose, ymin = 140, ymax = sensorglucose), fill = "red", alpha = 0.5) +
ggtitle(paste("Subject ", i," 24h Interstitial Glucose Levels")) + xlab('Date') + ylab('Interstitial Glucose (mg/dL)') + scale_color_manual(values = c("#EF476F", "#F6A21E", "#06D6A0", "#118AB2"))
figure1