R语言ggplot2可视化:自定义设置连续变量图例(legend)宽度(width)、自定义设置连续变量图例位置(position)、自定义设置连续变量图例连续渐变
#初始示例(图例互相分离、图例细线条)
temp.df <- data.frame(x=1:100,y=1:100,z=1:100,stringsAsFactors=FALSE)chart <- ggplot(data=temp.df,aes(x=x,y=y))chart <- chart + geom_line(aes(colour=z))chart <- chart + scale_colour_continuous(low="blue",high="red")chart <- chart + theme(legend.position="bottom")chart <- chart + guides(colour=guide_legend(keywidth=5,label.position="bottom"))chart
#R语言ggplot2可视
R语言ggplot2可视化:自定义设置连续变量图例(legend)宽度(width) 自定义设置连续变量图例位置(position) 自定义设置连续变量图例连续渐变