gpt4 book ai didi

r - 有什么办法可以在ggplot中设置线端样式或线连接样式吗?

转载 作者:行者123 更新时间:2023-12-04 18:49:22 25 4
gpt4 key购买 nike

有关 R 中可用的线端和线连接样式的说明,请参见
http://students.washington.edu/mclarkso/documents/line%20styles%20Ver2.pdf

对于 ggplot,我已经在 plot_theme() 和 ggplot2 opts 的 github 列表中搜索过 https://github.com/hadley/ggplot2/wiki/%2Bopts%28%29-List但没有找到线索,所以我认为不可能在 ggplot 中更改这些。

最佳答案

搜索 Baron 的网站(从 RSiteSearch 链接)提出了这种设置网格 lineend 的方法。范围。 'gglot2' 函数使用 grid 包,因此使用网格术语进行搜索,例如 lineend将更有效地找出晦涩的特征:

http://finzi.psych.upenn.edu/R/library/ggplot2/html/geom_path.html

 xy <- data.frame(x = rep(c(1:3,3:9), times=3), y = rep(10:1, times=3), 
type = rep(LETTERS[1:2], each=5), type2 = rep(LETTERS[3:5], each=10))
myplot <- ggplot(data = xy)+
geom_path(aes(x = x, y = y), size=4, lineend="butt",
linejoin="mitre")+facet_grid(type ~ type2)
myplot

(我不相信所有 linejoin 参数都被执行了,但是 lineend 设置得到了尊重,并且圆形连接绝对不同。)

关于r - 有什么办法可以在ggplot中设置线端样式或线连接样式吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8737563/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com