Is there a way to set the end of line style or line join style in ggplot?

For a description of line-ending styles and line styles available in R, see http://students.washington.edu/mclarkso/documents/line%20styles%20Ver2.pdf

For ggplot, I already searched in plot_theme (), and the gigub ggplot2 opts list is https://github.com/hadley/ggplot2/wiki/%2Bopts%28%29-List , but I didn’t find any links, so I think it’s impossible to change them in ggplot.

+5
source share
1 answer

- Baron ( RSiteSearch) grid 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

( , linejoin , lineend , .)

+6

All Articles