У меня проблемы с установкой y-break в моем коде.
Проблема в том, что «реальный» график достигает очень высоких значений, поэтому, когда я строю «low», «mean», «up» «и» реальные графики в одном и том же facet_grid, невозможно увидеть все линии и неопределенности. Таким образом, я хочу разбить ось y первого графика (реальный график) с 750000 (максимум вверх, минимум и средний график) до 1e14 и начать снова с 1e15 до 1.5e15.
В дополнение Я хочу разную важность для каждой шкалы y. Я имею в виду, я хочу уделять больше внимания (= больше места в y) низким значениям, давая больше утиков, и меньше важности для высоких значений (например, от 1e15 до 1.5e15, только 2 тика и очень близко между ними), чтобы увидеть все данные на графике.
Любая помощь? ¿? Я не знаю, что делать ...
КОД:
ggplot(data, aes(x= year)) +
geom_line(aes(x= year, y = median, colour = Dquant), size = 1) +
geom_line(aes( y = mean, colour = Dquant), size = 1, linetype="dashed") +
geom_ribbon(aes(ymin = min,
ymax = max, fill = Dquant), alpha = 0.3) +
facet_grid(~sce, scales="free") +
theme_minimal() +
theme( axis.title.x = element_blank(),
axis.title.y = element_blank(),
legend.title = element_blank(),
legend.text = element_text(size = 14),
legend.position="bottom")
участки:
Без реального
С настоящим
Данные:
Data <-
structure(list(year = c(1997, 1997, 1997, 1998, 1998, 1998, 1999,
1999, 1999, 2000, 2000, 2000, 2001, 2001, 2001, 2002, 2002, 2002,
2003, 2003, 2003, 2004, 2004, 2004, 2005, 2005, 2005, 2006, 2006,
2006, 2007, 2007, 2007, 2007, 2007, 2007, 2007, 2008, 2008, 2008,
2008, 2008, 2008, 2008, 2009, 2009, 2009, 2009, 2009, 2009, 2009,
2010, 2010, 2010, 2010, 2010, 2010, 2010, 2011, 2011, 2011, 2011,
2011, 2011, 2011, 2012, 2012, 2012, 2012, 2012, 2012, 2012, 2013,
2013, 2013, 2013, 2013, 2013, 2013, 2014, 2014, 2014, 2014, 2014,
2014, 2014, 2015, 2015, 2015, 2015, 2015, 2015, 2015, 2016, 2016,
2016, 2016, 2016, 2016, 2016, 2017, 2017, 2017, 2017, 2017, 2017,
2017, 2018, 2018, 2018, 2018, 2018, 2018, 2018), Dquant = c("1998-2018",
"1998-2018", "1998-2018", "1998-2018", "1998-2018", "1998-2018",
"1998-2018", "1998-2018", "1998-2018", "1998-2018", "1998-2018",
"1998-2018", "1998-2018", "1998-2018", "1998-2018", "1998-2018",
"1998-2018", "1998-2018", "1998-2018", "1998-2018", "1998-2018",
"1998-2018", "1998-2018", "1998-2018", "1998-2018", "1998-2018",
"1998-2018", "1998-2018", "1998-2018", "1998-2018", "1998-2018",
"1998-2018", "1998-2018", "2008-2018", "2008-2018", "2008-2018",
"2008-2018", "1998-2018", "1998-2018", "1998-2018", "2008-2018",
"2008-2018", "2008-2018", "2008-2018", "1998-2018", "1998-2018",
"1998-2018", "2008-2018", "2008-2018", "2008-2018", "2008-2018",
"1998-2018", "1998-2018", "1998-2018", "2008-2018", "2008-2018",
"2008-2018", "2008-2018", "1998-2018", "1998-2018", "1998-2018",
"2008-2018", "2008-2018", "2008-2018", "2008-2018", "1998-2018",
"1998-2018", "1998-2018", "2008-2018", "2008-2018", "2008-2018",
"2008-2018", "1998-2018", "1998-2018", "1998-2018", "2008-2018",
"2008-2018", "2008-2018", "2008-2018", "1998-2018", "1998-2018",
"1998-2018", "2008-2018", "2008-2018", "2008-2018", "2008-2018",
"1998-2018", "1998-2018", "1998-2018", "2008-2018", "2008-2018",
"2008-2018", "2008-2018", "1998-2018", "1998-2018", "1998-2018",
"2008-2018", "2008-2018", "2008-2018", "2008-2018", "1998-2018",
"1998-2018", "1998-2018", "2008-2018", "2008-2018", "2008-2018",
"2008-2018", "1998-2018", "1998-2018", "1998-2018", "2008-2018",
"2008-2018", "2008-2018", "2008-2018"), sce = structure(c(2L,
1L, 3L, 2L, 1L, 3L, 2L, 1L, 3L, 2L, 1L, 3L, 2L, 1L, 3L, 2L, 1L,
3L, 2L, 1L, 3L, 2L, 1L, 3L, 2L, 1L, 3L, 2L, 1L, 3L, 2L, 1L, 3L,
4L, 2L, 1L, 3L, 2L, 1L, 3L, 4L, 2L, 1L, 3L, 2L, 1L, 3L, 4L, 2L,
1L, 3L, 2L, 1L, 3L, 4L, 2L, 1L, 3L, 2L, 1L, 3L, 4L, 2L, 1L, 3L,
2L, 1L, 3L, 4L, 2L, 1L, 3L, 2L, 1L, 3L, 4L, 2L, 1L, 3L, 2L, 1L,
3L, 4L, 2L, 1L, 3L, 2L, 1L, 3L, 4L, 2L, 1L, 3L, 2L, 1L, 3L, 4L,
2L, 1L, 3L, 2L, 1L, 3L, 4L, 2L, 1L, 3L, 2L, 1L, 3L, 4L, 2L, 1L,
3L), .Label = c("real", "mean", "up", "low"
), class = "factor"), median = c(271250.933411761, 174329.842690641,
181988.279010382, 176326.661924226, 128322.447002041, 134693.604638111,
274986.723864926, 233927.074724176, 218592.867204935, 148779.734316761,
143074.499781715, 138605.14387934, 138986.037693604, 140406.834993171,
137148.680644009, 237118.679978143, 235327.177239454, 232563.719479456,
192520.645814095, 184107.296353477, 188924.610766882, 126242.612950543,
116564.164936345, 126142.679882613, 228401.785313612, 231600.864763052,
225778.708786399, 157634.684628256, 182620.381594339, 162596.829195135,
209609.647874702, 287685.989594668, 222039.329619513, 227218.657799938,
229536.354527116, 24052713437.3087, 275127.749195115, 316517.903895436,
525767.641837695, 347213.289117941, 379746.499264302, 336654.532566334,
55669475529.556, 409213.325193257, 522913.943442896, 906396.752084313,
568307.797375571, 523593.790627888, 580768.962810708, 72723342272.8429,
707133.893585878, 187300.561798093, 273876.888111204, 204509.914838313,
183536.60399367, 206218.037486455, 20633312274.0172, 249886.775275496,
197328.548918493, 298241.680770821, 215297.11601296, 194127.02247954,
214501.475793396, 22109752413.519, 264744.405297724, 206067.011853416,
325971.087455159, 224852.27070726, 200408.965400769, 227563.666986308,
26337155102.0573, 286321.383263596, 381055.745058772, 743238.963653956,
410020.333630838, 370135.899473898, 418236.650437978, 58099402495.751,
536035.150446747, 289455.888318165, 457319.155632952, 311353.245919098,
279102.802335806, 314680.011668731, 42170238120.2681, 413058.235362188,
180223.81576812, 228907.532444965, 198812.22107376, 174444.347359958,
199108.719109354, 22040096077.1082, 261646.314783439, 176943.664778089,
198266.511073489, 200036.565929875, 176780.88386372, 203807.205662623,
20358509050.6741, 264847.863281347, 247298.971362715, 281960.090434183,
293214.308624952, 257941.517747829, 307517.2239194, 27081019501.5515,
391478.682462643, 326063.568077276, 282731.10889422, 421368.649072822,
321337.216213794, 457318.609728295, 29796073288.7595, 591108.63326355
), mean = c(272345.269911437, 180596.815383997, 170855.016063135,
178655.502153251, 142421.910371093, 131686.485787666, 274500.130286522,
247461.446076309, 235115.772524758, 148733.094456303, 143432.084877213,
140510.197267933, 139197.527174579, 142619.493225591, 137004.723297707,
237307.162531229, 238820.975308384, 234020.823135885, 192588.784301406,
182060.030595796, 190159.024388065, 126218.368279055, 112088.601395985,
126133.779393713, 228512.205381352, 225016.800848212, 224802.630232783,
158194.341351618, 187822.312246315, 162606.514573339, 210416.492201143,
309748.295357797, 221430.842420298, 223617.793915441, 223903.125325354,
9904242352030.65, 260347.569773366, 318244.337883203, 579640.006666561,
345346.032505856, 370626.607279363, 332233.945505506, 21491776104474.9,
409209.242116443, 523904.60059478, 935075.323382305, 566479.595778939,
524678.248681422, 581007.533816242, 35943252213543.2, 723959.418747222,
187325.679465279, 259083.409164507, 202843.88926727, 184235.215391617,
205097.608470816, 11164970385302.4, 244124.370406846, 197286.064655086,
280673.977037158, 211594.093202052, 194185.432587594, 212285.047320748,
11989964680622.3, 254972.353149082, 206296.015356819, 333123.396710878,
222566.992906555, 200827.593580583, 226822.293863734, 13237495981083.1,
285728.077340759, 381571.683615591, 754078.140808609, 408933.259114676,
370594.912848239, 419346.460486419, 26288695395864.9, 548020.939606612,
287912.19373993, 501175.971126948, 308893.675894856, 278909.329103843,
315658.663216274, 18806763489671.7, 412551.998304845, 178939.806962114,
243313.283324597, 194457.361164901, 173719.872239641, 197541.850055512,
10184636434514.1, 256131.851707848, 177403.34711096, 213524.362512937,
196316.544146354, 175735.46737574, 200936.844576894, 9647773937737.83,
259807.063924946, 258889.707312201, 323325.068090412, 294039.758260533,
257891.806217259, 304292.222386475, 13021141129823.3, 394240.478502324,
351870.144130187, 341348.167592571, 433858.444814038, 326115.697814003,
454778.534719178, 14830154122741.7, 609740.233404267), min = c(269802.68250335,
165026.591496844, 126574.652185937, 174222.995448778, 106050.182129119,
119913.570073976, 270807.771046926, 197096.12888566, 212470.753857982,
145978.846402085, 106231.362505223, 134193.586498507, 138062.52403115,
126503.383887816, 133605.633178661, 235281.59322449, 222230.805547128,
228207.174754537, 190964.470905785, 152640.234535017, 187713.601278443,
125418.002356213, 86523.5097632671, 124622.780149688, 225262.170020554,
179612.356185615, 220612.628877919, 156321.389069322, 160397.044072993,
159960.822267813, 206398.31734288, 238358.040385515, 217739.87901193,
195753.063592292, 178744.326514639, 327141.444854716, 119721.194379894,
313554.265962317, 460829.647364256, 328862.786179365, 315756.176896512,
308802.557254049, 603581.269205954, 340043.148814031, 518077.044025802,
756208.430696753, 541472.184704768, 497202.755664717, 552030.720382341,
702668.693219908, 644077.611924028, 185330.442503585, 148118.250092641,
191477.117788122, 181194.047028436, 195196.041501458, 157398.084510526,
191753.229994009, 192761.312261542, 150027.56193971, 195080.24083109,
191927.456550835, 192398.516865925, 162980.34789673, 182842.545442381,
204034.579392594, 281249.906763058, 208657.455282282, 197286.587835601,
220924.755350833, 277492.299880875, 264955.905604042, 376842.026856835,
604016.132683022, 394661.973303136, 363749.247497405, 411976.760845692,
721990.196436554, 509498.941152034, 281467.170953993, 375434.082985228,
291194.019192411, 270759.652758784, 305567.665112867, 381585.753116895,
367429.586410073, 170502.304570832, 163886.531672811, 174162.179403628,
165661.529187133, 181592.565921378, 165493.058079916, 198276.94625014,
166460.172541479, 138247.546875601, 177118.869703294, 166720.123597407,
179486.297293851, 157491.856834842, 187034.351224574, 232586.815483861,
224346.889777313, 276104.401418121, 222214.536423694, 291030.371854759,
508016.06397275, 379575.5638416, 308191.383461263, 233500.324498805,
394546.510926069, 287999.388168663, 419817.803838022, 454332.119814492,
570672.894272458), max = c(278193.62359066, 206980.227162761,
191728.978011547, 187880.781166901, 206883.612492436, 138310.027772291,
276472.96458244, 331713.593444257, 306077.911224606, 150492.861179863,
171564.934557625, 149056.76857344, 141176.325878129, 157723.937507601,
140555.87470062, 238945.967349945, 263193.262355733, 243380.322769353,
194215.35004985, 196673.259565268, 196175.217916205, 127029.416371267,
120585.816723563, 128545.795332452, 231626.404194131, 244623.967187696,
228151.280756911, 164062.986138446, 218389.055631467, 166429.2805759,
217955.144479359, 429000.568575225, 223544.651843054, 252350.791158743,
244507.5310162, 401482091333531, 297208.11128433, 337745.037331985,
838917.931942716, 354310.970130017, 418405.714660983, 343045.455351557,
866974969584186, 428628.025302966, 538473.648185389, 1130409.68137682,
585061.699813275, 566710.336785715, 644921.104512694, 1497677059448270,
950787.716188074, 193112.575666243, 308014.186745896, 208886.813804999,
194561.544435964, 210253.640904286, 468157790957899, 258256.399357027,
207532.244131722, 335569.639438896, 221137.82141271, 197579.56820965,
221450.409861303, 502184816065837, 278087.337392696, 212416.557515791,
393915.329401621, 233246.578236797, 207220.849556175, 232965.727985277,
550487671445547, 296079.713374299, 397189.200940651, 997882.618308808,
426914.578558878, 381979.828473857, 457159.156157779, 1078252837711580,
617231.26184145, 295488.295870466, 724960.176626616, 323571.296542886,
291974.105065125, 338700.290465876, 769494647983116, 424067.319079536,
186066.925082783, 345890.088096459, 205127.209809905, 180554.987124241,
207977.775446729, 419326651118042, 278520.014245492, 185777.797105331,
294181.234660947, 206949.84763535, 181176.08041045, 209595.936803633,
398235630184494, 286367.51711188, 328697.656116281, 602828.312140973,
331412.517715862, 298274.862967901, 327115.761030605, 537894188568343,
417462.29787746, 516263.256323623, 971764.797371761, 543973.525737656,
391108.546615316, 571900.099240955, 613951949959179, 852004.250623592
)), row.names = c(8060L, 8062L, 8064L, 8564L, 8566L, 8568L, 9068L,
9070L, 9072L, 9572L, 9574L, 9576L, 10076L, 10078L, 10080L, 10580L,
10582L, 10584L, 11084L, 11086L, 11088L, 11588L, 11590L, 11592L,
12092L, 12094L, 12096L, 12596L, 12598L, 12600L, 13136L, 13138L,
13140L, 13144L, 13146L, 13148L, 13150L, 13712L, 13714L, 13716L,
13720L, 13722L, 13724L, 13726L, 14288L, 14290L, 14292L, 14296L,
14298L, 14300L, 14302L, 14864L, 14866L, 14868L, 14872L, 14874L,
14876L, 14878L, 15440L, 15442L, 15444L, 15448L, 15450L, 15452L,
15454L, 16016L, 16018L, 16020L, 16024L, 16026L, 16028L, 16030L,
16592L, 16594L, 16596L, 16600L, 16602L, 16604L, 16606L, 17168L,
17170L, 17172L, 17176L, 17178L, 17180L, 17182L, 17744L, 17746L,
17748L, 17752L, 17754L, 17756L, 17758L, 18320L, 18322L, 18324L,
18328L, 18330L, 18332L, 18334L, 18896L, 18898L, 18900L, 18904L,
18906L, 18908L, 18910L, 19472L, 19474L, 19476L, 19480L, 19482L,
19484L, 19486L), class = "data.frame")