在让 xyplot 为每个格子行使用不同的 ylim 之后(该部分有效),我最终在面板之间增加了一些我似乎无法驾驭的额外间距。在下面的示例中,我想
- (a) 去掉每列之间的三个间距
- (b) 让第 9 个面板上的轴标签(即第 1 行第 2 列第 4 列)出现在图的右侧。
- (c) 确保每个面板正好从 0 开始,正好在 10 结束(在 x 和 y 上):而不是像现在这样的 -0.1 和 10.1。
提前致谢,
图书馆(格)
库(latticeExtra)
B<-structure(list(yval = c(9.04558240029191, 0.799530758536875, 4.69069522598669, 1.91643037953314, 1.57786714979593, 1.8446918362001, 12.2500411978512, 3.07665190473454, 3.28898861276143, 6.01549253849571, 8.17821235705288, 3.79595798212791, 0.805594114806692, 6.41198823745342, 3.28568215145447, 7.98224159193929, 8.60366317617762, 5.42388511534892, 0.764825548373361, 3.9666691576256, 2.47156955689964, 7.27503578997147, 5.44633450784916, 6.60905274634776, 5.45786814114277, 0.758864205932014, 2.84057319554552, 5.04212318294901, 7.00770048354209, 4.38241850904838, 12.3629788063877, 0.761708333337782, 6.33197137795722, 6.67224995833747, 5.34251622052521, 8.66662936109525, 13.5204012323942, 4.0032083141389, 11.6843895681122, 12.8329939259479, 9.09319429081734, 4.8090480682483, 1.10183130102097, 2.85680676388518, 6.0430350387286, 0.864262666632898, 4.03505027841203, 7.83331437064888, 0.99216416521435, 8.1203144160401, 5.7347651851128, 13.0677987321833, 5.45030129828113, 6.78666709316608, 9.13141740602399, 3.96553096986173, 5.67648924810184, 4.02795185222417, 1.19923217249904, 8.00633581508868, 3.62564568701185, 0.945006814343432, 11.6861884359709, 9.17683187930724, 4.11952821761626, 9.48867838961486, 9.14151956014416, 9.93838160762052, 4.60891102702602, 6.99239234030028, 1.00586875673025, 8.57168767869193, 2.22835635254303, 10.7135685293467, 5.87713139624508, 3.14952893096586, 6.81194443415328, 3.36658738967144, 1.57839234760371, 4.65736854147361, 13.6432997178854, 1.15264945152674, 7.20595566631243, 0.925980641981997, 0.869008955269436, 4.75095327168301, 8.81030618436026, 3.92273652447446, 8.12949426073657, 5.76933378419949, 0.777256448291363, 2.38339350715339, 0.734001474102335, 9.52159088621359, 9.04970565702903, 6.90866926838569, 5.9005334817271, 7.00203106927033, 8.99155252630509, 8.94266111063583, 5.92279271877979, 4.42034111796866, 6.75839811937969, 8.64658069020977, 6.73162187983837, 7.81184984214652, 7.98579728627022, 3.37676029593063, 0.786919300835254, 6.26305128304185, 4.34845809230566, 3.95541090231129, 6.72281577578086, 0.695707197714119, 10.0560573020158, 4.15810837453519, 0.873004867283037, 4.16327733595061, 6.49503064101967, 8.12090562610595, 6.97504423312718, 5.04835565620835, 4.1951025387306, 3.4389006143913, 14.2771156202001, 7.03956347153237, 4.38618618413419, 2.37913020416628, 5.76940052627782, 6.7843580672236, 5.6189786720292, 0.858382930463266, 8.93422023821023, 6.66122216464326, 4.65890006006495, 2.49108732055206, 5.20714425399159, 6.76817735008579, 4.57887132963062, 8.17948756574428, 0.898004842730052, 2.87380239133325, 4.60134531154924, 6.10512608065437, 9.25669653387974, 4.02358360379974, 1.65752932816245, 13.0180323775825, 1.07835183694634, 6.77152818032083, 0.992191765039423, 9.30217478579486, 0.97874136454804, 0.866890009992784, 8.817554894806, 0.7272450310133, 8.44736877413528, 0.920962179334358, 6.74426140262635, 11.4976862396927, 6.83227936730633, 6.65379134595895, 8.08853124664082, 8.42288560540892, 6.74875380809505, 2.36799257646616, 4.36076052102911, 5.37997507455859, 2.74739395725121, 0.711432451231922, 0.88339933260502, 3.99251745639107, 6.00066182640637, 4.70148688755132, 1.49531958692362, 4.63991117659694, 6.85411354349471, 6.46882156338255, 6.85653606216362, 4.00308723827046, 4.48618366295549, 10.111122152813, 6.18726852405011, 4.21496939061236, 8.08951972351983, 5.75062772615253, 5.52475848522626, 1.26794710186864, 9.01653579750459, 6.11422725714239, 9.53492872517571, 0.880694109464262, 6.81404895940322, 5.87046596781633, 0.987684218656088, 0.905904225040102, 0.709536461897921, 9.54425897216572, 2.42394501347149, 2.39393463069561), xval = c(7.47963566160188, 7.53843824926937, 7.89102425119663, 0.714250331034379, 0.350808447161537, 0.920278439461499, 2, 1.18120433837389, 2.15668307822314, 3.53934453115817, 4.54534178644686, 6.35156921947863, 6, 5.85193346902148, 0.257061197908195, 4.31405462193795, 7.44504037562708, 1.6419865257507, 5.92245885664568, 5.85762870655473, 2.41500543375237, 2.05255225180268, 2.61260633367393, 7.38952812116483, 3.40841861174166, 5.56641353876732, 1.06334634355079, 1.22092009561206, 7.14905823173125, 7.77833375224301, 6.48602609472388, 2.22876858735943, 4.63608825703697, 7.20409587755302, 3.94029557829791, 5.49693346564516, 8, 3.68168379693831, 4.53399156590835, 2, 3.20232386763659, 3.11465409149307, 3.59096547110588, 0.970635458843625, 3.79609219567095, 7.55431365252621, 3.84830138707843, 8, 9.68422707545899, 6.45952162701766, 2.61260633367393, 8, 2.80146412397853, 2.71523669358035, 3.34195216347927, 5.7052168115031, 4.83629254883881, 3.00634266399471, 0.161521370138566, 2.77915434648176, 0.430882606717923, 6.40468404364395, 8, 1.82254474904725, 2.02274863777057, 0.0952104996681957, 1.18810690234325, 4, 0.707737916689389, 6.61645186383278, 6.80447998235695, 5.0388851286179, 8.33100258777955, 2.88309613397185, 2.50046471894888, 1.43831427763256, 8.80421484592245, 2.43273028649955, 3.18832058131858, 0.721572350979251, 8, 1.907891777796, 1.05560820975072, 9.99619906048348, 6.68527581003685, 8.69201244754421, 5.84110748159124, 8.0167791392137, 6.33916453325404, 2.2417758680228, 5.0575474022438, 0.434518494934576, 7.63978081682492, 5.19955013543875, 7.49576429936454, 8.70020957978785, 2.56269498257904, 6.90165751709627, 7.3319320403241, 6.9801288946986, 0.251493263610557, 5.70219219685056, 9.07813067781478, 9.68422707545899, 7.69678435668618, 4.88668899911176, 2.6243179089804, 1.80110071603502, 4.64623158623263, 6.40047515568851, 2.07682859084626, 3.3080241101838, 7.45291987882876, 3.20531761919078, 8.70020957978785, 7.65805776625107, 9.51348984354148, 7.75570667603492, 5.23744300265713, 3.66772339261955, 9.96838812401567, 1.22757975659896, 2.10117458601233, 4.30252110036365, 8, 9.7853969925673, 7.8498968972544, 1.06023998229514, 2.80808561311523, 8.936106857321, 4.33847136469, 2.28195392443262, 2.71065687399482, 7.11534497790504, 0.736599072564448, 0.0371367578969133, 1.66833297125009, 2.25721316147136, 1.25087606440674, 0.196049047891455, 9.47293734757645, 1.68846238246007, 8.39657940508961, 2.99332681317713, 6, 6.21814736208532, 0.582872210285507, 2, 6.70176650693179, 7.25659815967902, 1.89552337969659, 6, 7.64691089050179, 5.90288700711154, 4.50475630428356, 4.71258989491385, 4.40677648764997, 9.96001027491324, 8.20245208325319, 2, 8.09144329864304, 7.05910754176663, 3.38701780181836, 4.272006377931, 8.98520317584308, 0.59821501073407, 9.81164531780974, 4.19141637809377, 1.44318685936535, 8.79864437508768, 3.21596961924959, 1.99186824405878, 3.28063130382249, 8.05841625618546, 0.106451981669153, 7.18587595643851, 2.35872287708421, 7.46774138570701, 8.19156257322725, 3.09809701159013, 9.1323987488354, 9.33479740023197, 3.40547170163811, 2.23290070547077, 6.82128728998622, 0.175226827422645, 1.93267256652364, 3.29266684711463, 4, 4.71250021739426, 4, 8.96389342027811, 7.6410830341138, 2.2417758680228, 3.92681182511134, 8.23603091257415, 9.29870572131864, 5.33258781492592, 1.78141216060964, 1.86262944881485 ), gval = c(2, 4, 2, 4, 4, 3, 1, 2, 4, 3, 4, 2, 3, 2, 2, 2, 3, 2, 1, 4, 1, 1, 2, 1, 2, 4, 4, 3, 4, 2, 1, 1, 3, 2, 1, 1, 4, 2, 1, 1, 1, 4, 3, 2, 3, 1, 2, 4, 4, 4, 3, 4, 2, 3, 1, 4, 4, 4, 4, 4, 2, 1, 4, 4, 1, 4, 1, 2, 3, 4, 3, 1, 4, 1, 3, 3, 4, 4, 1, 2, 4, 1, 4, 3, 3, 2, 4, 2, 4, 3, 1, 3, 1, 1, 2, 3, 3, 4, 1, 1, 1, 2, 2, 1, 3, 3, 4, 4, 4, 4, 4, 4, 3, 3, 1, 4, 3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3L, 2L, 4L, 2L, 3L, 3L, 4L, 3L, 3L, 4L, 3L, 3L, 2L, 2L, 3L, 1L, 1L, 3L, 1L, 2L, 1L, 4L, 3L, 1L, 4L, 1L, 1L, 3L, 1L, 3L, 1L, 4L, 4L, 4L, 4L, 3L, 2L, 2L, 3L, 2L, 1L, 4L, 3L, 4L, 2L, 2L, 3L, 3L, 3L, 2L, 2L, 2L, 2L, 3L, 4L, 1L, 3L, 3L, 3L, 2L, 1L, 3L, 4L, 3L, 3L, 2L, 2L, 2L, 2L, 3L, 2L, 1L, 2L, 4L, 3L, 3L, 1L, 4L, 1L, 1L, 2L, 1L, 3L, 2L, 2L, 2L, 3L, 3L, 2L, 1L, 4L, 1L, 4L, 3L, 2L, 1L, 1L, 2L, 1L, 1L, 3L, 2L, 2L, 4L, 1L, 4L, 1L, 3L, 2L, 1L, 3L, 3L, 2L, 2L, 4L, 3L, 4L, 3L, 1L, 2L, 3L, 3L, 4L, 3L, 2L, 2L, 4L, 1L, 4L, 2L, 3L, 2L, 2L, 3L, 2L, 4L, 1L, 1L, 2L, 4L, 2L, 3L, 3L, 3L, 4L, 1L, 4L, 1L, 2L, 3L, 3L, 4L, 3L, 2L, 1L, 4L, 2L, 2L, 2L, 3L, 3L, 3L, 1L, 3L, 1L, 3L, 1L, 1L), .Label = c("4", "8", "12", "20"), class = "factor"), nsamp = c(500, 100, 300, 500, 100, 200, 100, 300, 200, 200, 300, 100, 100, 200, 500, 500, 500, 200, 100, 200, 300, 100, 100, 500, 100, 100, 300, 100, 200, 200, 500, 100, 300, 200, 500, 200, 100, 300, 500, 100, 300, 500, 300, 300, 200, 200, 300, 100, 100, 300, 100, 100, 100, 500, 300, 100, 500, 100, 100, 300, 100, 300, 100, 500, 500, 500, 500, 100, 200, 200, 300, 200, 100, 500, 300, 500, 200, 200, 300, 300, 100, 200, 200, 200, 200, 300, 500, 100, 300, 300, 300, 200, 100, 300, 500, 300, 300, 200, 200, 200, 200, 300, 200, 100, 200, 500, 300, 300, 100, 500, 100, 100, 200, 100, 300, 200, 200, 200, 300, 300, 200, 100, 500, 100, 100, 300, 200, 100, 100, 200, 100, 100, 300, 200, 200, 500, 100, 500, 100, 300, 200, 100, 300, 300, 100, 200, 500, 100, 500, 300, 100, 100, 300, 300, 500, 300, 200, 200, 500, 100, 500, 200, 300, 200, 200, 300, 200, 500, 100, 100, 200, 500, 200, 300, 300, 300, 500, 100, 500, 100, 200, 300, 300, 500, 300, 200, 100, 500, 100, 200, 100, 300, 300, 300, 100, 300, 100, 300, 100, 100), grp = c(4, 2, 2, 2, 2, 2, 5, 2, 2, 4, 4, 2, 5, 4, 4, 4, 4, 4, 2, 2, 2, 4, 4, 2, 4, 2, 2, 4, 4, 2, 4, 2, 4, 4, 2, 4, 5, 2, 4, 5, 4, 2, 2, 2, 4, 2, 2, 5, 4, 4, 4, 5, 4, 4, 4, 4, 2, 4, 2, 4, 4, 2, 5, 4, 2, 4, 4, 5, 4, 4, 2, 4, 4, 4, 4, 2, 4, 2, 2, 4, 5, 2, 4, 2, 2, 2, 4, 2, 4, 4, 2, 2, 2, 4, 4, 4, 4, 4, 4, 4, 4, 2, 4, 4, 4, 4, 4, 2, 2, 2, 4, 4, 4, 2, 4, 2, 2, 2, 4, 4, 4, 4, 2, 2, 5, 4, 2, 2, 4, 4, 4, 2, 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 4, 5, 2, 2, 5, 2, 4, 2, 5, 2, 2, 4, 2, 4, 2, 2, 5, 2, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 4, 4, 2, 4, 2, 4, 4, 2, 4, 4, 4, 2, 5, 4, 5, 2, 4, 4, 2, 2, 2, 4, 2, 2)), .Names = c("yval", "xval", "gval", "type", "cr", "p", "nsamp", "grp"), row.names = c("25155", "42789", "46517", "49502", "42342", "44189", "592", "46071", "44843", "20664", "23997", "41460", "1395", "20144", "24836", "25020", "25616", "19868", "40797", "45051", "45473", "16611", "17292", "48391", "17346", "42670", "47427", "17848", "21588", "44011", "24651", "40559", "23361", "20239", "48249", "19450", "2250", "46260", "24569", "341", "21971", "49634", "46933", "46054", "20688", "43408", "46269", "2415", "19049", "24104", "17941", "2403", "17304", "25413", "21976", "18791", "49720", "18616", "42333", "23874", "17149", "45734", "2278", "25830", "48149", "25754", "24413", "853", "20484", "21549", "47123", "19415", "18976", "24497", "23212", "49071", "21704", "44856", "45532", "22469", "2120", "43066", "21186", "44723", "44522", "46582", "26012", "41553", "24096", "23192", "45652", "44153", "40894", "22105", "25156", "23616", "23216", "21565", "19570", "19542", "19091", "46373", "20365", "17102", "20965", "25512", "23861", "47489", "42599", "49788", "18560", "18638", "20934", "41880", "22330", "45179", "44688", "45185", "22749", "23931", "21101", "17849", "48153", "41313", "2005", "23698", "44019", "42378", "17954", "21032", "17413", "41830", "21941", "20231", "20490", "25283", "17236", "24924", "18500", "23724", "43509", "41155", "47923", "22598", "1823", "45077", "48067", "578", "49321", "22867", "41806", "1821", "47180", "45705", "25957", "47004", "19369", "44718", "49865", "250", "48907", "20225", "23910", "19360", "21714", "46026", "45295", "49690", "41142", "42888", "43145", "49575", "20651", "46530", "46000", "46472", "24929", "18267", "48912", "18621", "44081", "22380", "22625", "49588", "24130", "19088", "17899", "49170", "953", "20072", "1201", "45925", "22901", "22549", "42555", "47227", "42921", "22112", "42430", "42436" ),class = "data.frame")
我的面板<-function(...){
if(current.row()<3){
panel.grid(v=-1,h=-1,col="dark grey")
panel.xyplot(...)
} else {
panel.grid(v=-1,h=-1,col="dark grey")
panel.bwplot(...,pch="-",cex=3,
fill=cl,horizontal=FALSE,
stats=adjboxStats)
}
}
编辑格式
ato<-rep(list(NULL),12); ato[[8]]<-ato[[1]]<-ato[[9]]<-TRUE;
alte<-rep(list=c(2),12); alte[[8]]<-list(2);
lmi<-rep(list(c(0,10),c(0,10),c(0,20)),4);
useOuterStrips(xyplot(B$yval~B$xval|B$p*B$grp,group=B$gval,
type=c("l","g"),lwd=2,cex.lab=1.5,as.table=TRUE,
par.settings=list(plot.symbol=list(pch="*",col="black",cex=1),
box.umbrella=list(lty=1,col="black",lwd=2),cex=2,
par.xlab.text=list(cex=1),axis.text=list(cex=1),
par.ylab.text=list(cex=1)),panel=mypanel,
scales=list(y=list(relation="free",limits=lmi,at=ato,alternating=alte))))