Есть ли способ заставить
align.plots()
(ggExtra) создать график, где «отдельные» оси Y имеют одинаковую высоту / длину?
Plot1:
kurth.plot <- qplot(x=trade.date, y=kurth, data=finalregstack, geom='line')+scale_y_continuous(name='')+scale_x_date(name='', expand=c(0,0))+opts(panel.background=theme_rect(),panel.grid.major=theme_blank(), panel.grid.minor=theme_blank(), plot.margin = unit(c(1,0,0,0), "lines"))
Plot2:
skewh.plot <- qplot(x=trade.date, y=skewh, data=finalregstack, geom='line')+scale_y_continuous(name='')+scale_x_date(name='', expand=c(0,0))+opts(panel.background=theme_rect(),panel.grid.major=theme_blank(), panel.grid.minor=theme_blank(),plot.margin = unit(c(-1,0,0,0), "lines"))
Plot2:
logpremh.plot <- qplot(x=trade.date, y=logpremh, data=finalregstack, geom='line')+scale_y_continuous(name='')+scale_x_date(name='', expand=c(0,0))+opts(panel.background=theme_rect(),panel.grid.major=theme_blank(), panel.grid.minor=theme_blank(), plot.margin = unit(c(-1,0,0,0), "lines"))
Все из одного фрейма данных (finalregstack), с trade.date на одной оси x.
align.plots(kurth.plot, skewh.plot, logpremh.plot)
возвращается на график, где ось Y имеет разную высоту.Хотелось бы иметь три графика одинакового размера, а также галочки и axis.text на всех осях X ...
finalregstack:
structure(list(trade.date = structure(c(11869, 11870, 11871,
11876, 11877, 11878, 11879, 11880, 11883, 11884, 11885, 11886,
11887, 11890, 11891, 11892, 11893, 11894, 11897, 11898, 11899,
11900, 11901, 11904, 11905, 11906, 11907, 11908, 11911, 11912,
11913, 11914, 11915, 11918, 11919, 11920, 11921, 11922, 11926,
11927, 11928, 11929, 11933, 11934, 11935, 11936, 11939, 11940,
11941, 11942, 11943, 11946, 11947, 11948, 11949, 11950, 11953,
11954, 11955, 11956, 11957, 11960, 11961, 11962, 11963, 11964,
11967, 11968, 11969, 11970, 11971, 11974, 11975, 11976, 11977,
11978, 11981, 11982, 11983, 11984, 11985, 11988, 11989, 11990,
11991, 11992, 11995, 11996, 11997, 11998, 11999, 12002, 12003,
12004, 12005, 12006, 12009, 12010, 12011, 12012), class = "Date"),
kurth = c(-0.538313927970605, -0.489599831389002, -0.549781828821448,
-0.471480517120967, -0.77047442140922, -0.764965969697188,
-0.797709358466937, -0.832263316808549, -0.739745115199957,
-0.737998397925412, -0.67595581513572, -0.765405764054348,
-0.901490974527926, -0.89225716170503, -0.939998163588295,
-0.758003571622454, -0.947725995002572, -1.00684152882085,
-1.00573304351807, -0.934273517386361, -0.859399051665602,
-0.942893064943436, 2.47305763864541, 2.06181470542550, 1.56582316347337,
1.19831125493319, 1.22311352859957, 1.15155464086347, 8.89610455063215,
8.86956391322178, 8.68580530405464, 8.61123904123055, 8.7400669250269,
8.79737625016586, 8.78629168919513, 8.29623941128428, 8.05754059674136,
8.02077532530273, 8.23011985866437, 8.24401447203093, 7.92294576051403,
7.4281887928507, 7.3426056371313, 7.30433477318178, 7.32670525202146,
7.17139705328142, 7.25310778701676, 7.1313581631237, 6.90092496220942,
6.81977869235276, 8.7728390134954, 9.0300473239695, 9.86979682886692,
10.0467584323277, 9.18063174440517, 9.60705497699159, -0.834707723641238,
-0.831476742135092, -0.683003538196646, -0.128689206047591,
-0.0486840773604658, -0.193928790670311, -0.372070480951705,
1.24156083387007, 2.16386195607461, 1.94481670179387, 1.87512691616447,
1.60466257254115, 1.58162121662634, 1.82406671267336, 2.14439006082267,
2.11326738777539, 1.84632151012893, 1.81703000912427, 1.70683982987174,
1.52156804636807, 1.37669564606729, 1.34356392851010, 1.38192685184208,
0.979515684470376, 0.888891137016543, 0.675602543012428,
0.661040087943164, 0.806562602010497, 1.03315305152296, 0.78156186596084,
0.8053103693573, 0.826531073748131, 0.825522225795727, 0.898444393507555,
1.10994069195078, 1.10994069195078, 1.10994069195078, 1.1364451896438,
1.09982566285141, 1.85866580040354, -0.351810796009023, -0.096669160154403,
-0.492681631027265, -0.288429330247108), skewh = c(0.558228477951341,
0.58308901843335, 0.609602375964546, 0.477880650885013, 0.387805408324395,
0.387839989209099, 0.286456452315072, 0.193331879936383,
0.206591453689309, 0.0971220953017504, 0.221147814384501,
0.187595125737881, 0.0524187756954932, 0.0961716860713602,
0.182338727065898, 0.264757353490630, 0.163830324947476,
0.143991871613884, 0.144463923069265, 0.0730550579677163,
0.183757658876955, 0.0656791648713786, 1.18950139112842,
1.09434539636253, 0.802846925891693, 0.63602979484928, 0.672813293573144,
0.736614149819276, -2.33563391004889, -2.31143640895283,
-2.31727166871707, -2.32876897713447, -2.38781198320570,
-2.37160833347724, -2.33074692187816, -2.24219936843415,
-2.21001773133659, -2.17823730104347, -2.2105667535483, -2.22156866044437,
-2.19942975461446, -2.07253305889856, -2.0419313498378, -2.02266448996358,
-1.97786014003463, -1.95408902307469, -1.98284250481692,
-1.93088774946092, -1.92119697583021, -1.88750434547032,
-2.45890556022003, -2.53154407812213, -2.67753652485642,
-2.70481025800469, -2.54591006187052, -2.62989769761383,
0.247330549690984, 0.228815399584095, 0.227991391662379,
0.571885460253403, 0.689877958381067, 0.533755075074511,
0.400111197818491, -0.535379813307516, -1.12355112329518,
-1.11402405119459, -1.06419661476207, -1.01542648507456,
-0.98798275182458, -1.01968536538631, -1.13136880338172,
-1.11658585003117, -1.08702903755025, -1.07310996361807,
-1.04443252316148, -0.98146201617556, -0.989718695652915,
-0.978648824220157, -0.93936499984734, -0.842000316650154,
-0.856125603005716, -0.752318760987758, -0.743850925871073,
-0.847638348832287, -0.918625055313669, -0.846416731547665,
-0.864256826872963, -0.890095785952014, -0.892616437941412,
-0.867123449112882, -0.936966060328, -0.936966060328, -0.936966060328,
-0.758598109998537, -0.682579399329156, -0.619814484766827,
0.620814547041089, 0.725657661522822, 0.592805261790067,
0.721071190789906), logpremh = c(-0.995610217466355, -0.70000069009059,
-0.678144103868504, -0.678144103868504, -0.494505232880775,
-0.484213835616396, -0.495268057973604, -0.372900957639147,
-0.450480847761974, -0.437795043597507, -0.517585169818772,
-0.430739184642212, -0.415173125239592, -0.313292951895139,
-0.552202213743963, -0.646341796497822, -0.715263921701793,
-0.660538105883145, -0.64253792833408, -0.491943429630031,
-0.605111281016567, -0.687871516304753, -0.819398672581242,
-0.720843146615785, -0.554697314678323, -0.604358822116492,
-0.635963319554632, -0.58688762990502, -0.533766579673723,
-0.549540818233004, -0.509744651370597, -0.497574488575739,
-0.50295497641327, -0.465150684081682, -0.471107502191422,
-0.484308973579098, -0.519413594601966, -0.409658720851543,
-0.409658720851543, -0.312434559177703, -0.240594651315486,
-0.187647447055703, -0.187647447055703, -0.431835237434803,
-0.492239335398449, -0.601873889653004, -0.847778497243267,
-1.28468760005568, -1.34064083106371, -1.32738794981778,
-1.43946408093213, -1.66269758662786, -1.56874565640878,
-1.68389571629343, -1.57211119569467, -1.49267822488204,
-1.42922611404924, -1.74337835169184, -1.75526498666775,
-1.65718139709817, -1.49798628913073, -1.3162509752857, -1.25568570523457,
-1.32158185197453, -1.32751736653430, -1.79028679759309,
-1.68133286507375, -1.59210428304230, -0.358448286780251,
-0.282320721989257, -0.222935326576976, -0.140064751669158,
-0.0652636984938439, -0.0843461362304372, -0.065141838860399,
-0.0424518787941153, 0.0550573562398911, -0.190765741146921,
-0.269701195073448, -0.173665980472658, -0.0334693122151012,
-0.539434660595658, -0.376468992885012, -0.446138926996241,
-0.368295712776361, -0.203379346763717, -0.123717788393908,
-0.0460878584714188, -0.463198358966021, -0.726046498313927,
-1.00170780286485, -0.831902448806796, -0.804806611101685,
-0.787069116472282, -0.97805437572716, -0.908526799872866,
-0.735307225195469, -0.696862274769597, -0.635797410804945,
-0.514329954731469)), .Names = c("trade.date", "kurth", "skewh",
"logpremh"), row.names = c("2002-07-01", "2002-07-02", "2002-07-03",
"2002-07-08", "2002-07-09", "2002-07-10", "2002-07-11", "2002-07-12",
"2002-07-15", "2002-07-16", "2002-07-17", "2002-07-18", "2002-07-19",
"2002-07-22", "2002-07-23", "2002-07-24", "2002-07-25", "2002-07-26",
"2002-07-29", "2002-07-30", "2002-07-31", "2002-08-01", "2002-08-02",
"2002-08-05", "2002-08-06", "2002-08-07", "2002-08-08", "2002-08-09",
"2002-08-12", "2002-08-13", "2002-08-14", "2002-08-15", "2002-08-16",
"2002-08-19", "2002-08-20", "2002-08-21", "2002-08-22", "2002-08-23",
"2002-08-27", "2002-08-28", "2002-08-29", "2002-08-30", "2002-09-03",
"2002-09-04", "2002-09-05", "2002-09-06", "2002-09-09", "2002-09-10",
"2002-09-11", "2002-09-12", "2002-09-13", "2002-09-16", "2002-09-17",
"2002-09-18", "2002-09-19", "2002-09-20", "2002-09-23", "2002-09-24",
"2002-09-25", "2002-09-26", "2002-09-27", "2002-09-30", "2002-10-01",
"2002-10-02", "2002-10-03", "2002-10-04", "2002-10-07", "2002-10-08",
"2002-10-09", "2002-10-10", "2002-10-11", "2002-10-14", "2002-10-15",
"2002-10-16", "2002-10-17", "2002-10-18", "2002-10-21", "2002-10-22",
"2002-10-23", "2002-10-24", "2002-10-25", "2002-10-28", "2002-10-29",
"2002-10-30", "2002-10-31", "2002-11-01", "2002-11-04", "2002-11-05",
"2002-11-06", "2002-11-07", "2002-11-08", "2002-11-11", "2002-11-12",
"2002-11-13", "2002-11-14", "2002-11-15", "2002-11-18", "2002-11-19",
"2002-11-20", "2002-11-21"), class = "data.frame")