【问题标题】:remove top and right border from ggplot2 [duplicate]从ggplot2中删除顶部和右侧边框[重复]
【发布时间】:2013-05-22 11:09:51
【问题描述】:

是否可以从 ggplot2 图形中删除顶部和右侧边框?

也就是说,我想保留 x 轴和 y 轴,但删除围绕图形的其余黑框。

//M

【问题讨论】:

    标签: r ggplot2


    【解决方案1】:

    查看这个帖子,它专门处理这里的问题

    http://groups.google.com/group/ggplot2/browse_thread/thread/f998d113638bf251

    并给出一个似乎可行的解决方案。

    【讨论】:

    【解决方案2】:

    你可以把它添加到你的情节中

    + opts(panel.grid.minor = theme_blank()) 
    + opts(panel.grid.major = theme_blank()) 
    + opts(axis.line = theme_segment())
    

    自 0.9.2 版起,opts 已被 theme 取代:

    + theme(panel.grid.minor = element_blank()) 
    + theme(panel.grid.major = element_blank()) 
    + theme(axis.line = element_segment())
    

    【讨论】:

    • 我有以下功能:theme_white
    • 也许可以尝试设置 panel.border=theme_blank() 以清除绘图周围的所有边框。
    • 你能上传一张图片让我看看错误在哪里吗?
    • 终于找到了...panel.background=theme.rect(colour=NA)
    猜你喜欢
    • 2018-03-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多