R:将X面面板下蜱在GGPLOT2

问题描述:

在刻面的曲线图从ggplot2包能够通过所述函数来改变刻度标记的位置等scale_x_continuous(position="top")。然而,如果刻度线的放置在上面,他们似乎上面刻面的面板,如下:R:将X面面板下蜱在GGPLOT2

library(ggplot2) 
ggplot(mpg, aes(displ, cty)) + geom_point() + 
facet_grid(. ~ cyl) +coord_flip() + 
scale_y_continuous(position="right") 

enter image description here

是否有可能把个别刻度秤面的的denotations?

+0

和工作重复的例子,是在哪里呢? – hrbrmstr

+2

可以互换带和轴grobs的位置; 'g = gplotGrob(p); indax = grep的( “轴-T”,克$ $布局名); indst = grep(“strip -t”,g $ layout $ name); AX =克$布局[indax,C( “T”, “B”)]; st = g $ layout [indst,c(“t”,“b”)];克$布局[indax,C( “T”, “B”)] user20650

如何推动小面板的底部?

library(ggplot2) 
ggplot(mpg, aes(displ, cty)) + geom_point() + 
    facet_grid(. ~ cyl, switch='x') +coord_flip() + 
    scale_y_continuous(position="right") 

enter image description here