r - 如何在图例中获取 "type=b"行

标签 r legend

有没有办法获取type = "b"作为我图例中的线型?

我希望我的图例看起来与图中的点相同:

x  <-  c(1:3)
plot(x, x, type="b")
legend("bottomright", c("dinges"), cex=1.2, pch=c(21), lty=1, bty="n")  

最佳答案

只需添加 pt.bg = 'white' .这会使点的背景颜色变白。

plot(x, x, type="b")
legend("bottomright", c("dinges"), cex=1.2, pch = 21,pt.bg = 'white', lty = 1, bty="n")

关于r - 如何在图例中获取 "type=b"行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18233236/

相关文章:

r - 多重 t 检验比较

matlab - 移动图例中的线

jquery - legenditemclick 上的 Highcharts 饼图避免切片饼图,但在图例元素上显示动画

R 循环 :conditioning a loop in R

R dplyr : summarise complete cases by group for all variables

r - 在ggplot2中设置base_size时重叠轴标签

matlab - 如何将结构体中的值绘制为不同的线,以便我可以控制它们的颜色 Matlab?

r - 在 R 中栅格的每个单元格上应用函数(按位 "and")?

r - 在 R 中添加颜色和气泡大小图例

jquery - Jqplot:附加右对齐文本和堆栈圆环图