【问题标题】:Is there a way to square off line margins in histogram plot in R? [duplicate]有没有办法在 R 的直方图中消除线边距? [复制]
【发布时间】:2017-03-30 20:54:16
【问题描述】:

我在 R 中使用 plot(type = 'h') 制作了直方图。

plot(type='h', y =runif(1:10), x = 1:10,lwd = 20,lty=7)

我希望竖条粗一些,所以我增加了lwd。 但是,较大的“条”(实际上,它们是 线条)具有圆形边缘:

有没有办法让这些“条”(即线)具有方形/直边?

我已经多次查看plot documentation 并找不到解决方案。 SE 或 Google 搜索也没有发现任何东西...

【问题讨论】:

    标签: r plot formatting histogram bar-chart


    【解决方案1】:

    使用lend = 1

    plot(type='h', y =runif(1:10), x = 1:10,lwd = 20,l ty = 7, lend = 1)
    

    然后输出

    【讨论】:

    • 非常感谢您让我参与其中!完美运行!
    猜你喜欢
    • 2011-10-13
    • 2015-05-05
    • 1970-01-01
    • 1970-01-01
    • 2022-01-20
    • 2020-07-27
    • 2021-09-19
    • 1970-01-01
    • 2019-05-20
    相关资源
    最近更新 更多