有没有办法在ggplot中设置行结束样式或行连接样式?

Ale*_*mbe 5 r ggplot2

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

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

42-*_*42- 6

使用Baron的网站(从RSiteSearch链接)进行搜索会调出此方法来设置网格lineend参数.'gglot2'函数使用网格包,因此使用网格术语搜索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
Run Code Online (Sandbox Code Playgroud)

(我不相信所有linejoin参数都被采取行动,但lineend设置得到尊重,圆形连接肯定是不同的.)