ls("package:ggplot2", pattern="^scale_fill.+") # [1] "scale_fill_binned" "scale_fill_brewer" "scale_fill_continuous" # [4] "scale_fill_date" "scale_fill_datetime" "scale_fill_discrete" # [7] "scale_fill_distiller" "scale_fill_fermenter" "scale_fill_gradient" #[10] "scale_fil...
scale_fill_distiller(palette = "RdBu",direction = 1) ggsave("3_vennplot.jpg",width = 5, height = 4) ##'@2维 ggVennDiagram(x[1:2],label = "count", label_alpha = 0)+ scale_fill_distiller(palette = "Set3",direction = 1) ggsave("2_vennplot.jpg",width = 5, height = 4) 1...
geom_line(colour="black") + geom_point(shape = 21, colour = "black", aes(fill = value), size=5, stroke=1) + scale_x_continuous(limits = c(1880,2017)) + scale_y_continuous(limits = c(-0.5,1)) + scale_fill_distiller(palette = "RdYlBu", limits = c(-1,1), guide = FALSE)...
geom_sf_label(data = venn_region(df),aes(label=id),fontface="bold")+ scale_fill_distiller(palette = 5)+ theme_void() 1. 2. 3. 4. 5. 6. 7. 是不是很神奇,不过还是封装好的画图函数的更好用的一点。 而且,不太容易找到好看的颜色搭配。
scale_fill_distiller(palette ="Set2",direction=1) + expand_limits(x = world$long, y = world$lat) + xlab("经度") + ylab("纬度") 这里做的并不像之前的图那么优雅,因为这个图的数据复杂一些。map_data("world")这个数据对于中国边界的经纬度数据是由一些问题的,如果要出版的话要尤为注意: ...
b+ scale_fill_brewer(palette = "Blues")也可以用scale_fill_grey()函数使用灰度,通过start end 两个参数指定,0为黑,1为白,都在0-1范围内 b + scale_fill_grey()b + scale_fill_grey(start=1, end=)连续型变量 gradient 创建渐变色 distiller使用ColorBrewer的颜色 identity 使用color变量对应的颜色,...
使用scale_fill_distiller()函数添加颜色 颜色的选择 ## 查看全部主题颜色,或是自己设置RColorBrewer::display.brewer.all() 例子3: ggVennDiagram(x[1:2],label="both")+scale_fill_distiller(palette="Spectral",direction=1) 3.3 线条的选择,使用edge_lty =进行寻找,默认是实线,虚线参数为dashed。
scale_fill_distiller(palette = "RdYlBu", limits = c(-1,1), guide = FALSE) + xlab("") + ylab("Difference from 1900-2000 (ºC)") + theme_minimal(base_size = 16, base_family = "Georgia") 结果应该是: 该文件包含字段和,后者是全球年平均气温,相比于1900-2000的平均水平。
scale_*_distiller()for a continuous variable scale_*_brewer()for a discrete variable To use a specific color palette, you can simply addpalette = "palette name"insidescale_fill_distiller(). The codes below applies “Spectral” as an example. ...
p<-ggplot(mean.temp,aes(Month,Temp,fill=Temp))+geom_col()+scale_fill_distiller(palette="Reds",direction=1)+theme_minimal()+theme(panel.grid=element_blank(),panel.grid.major.y=element_line(color="white"),panel.ontop=TRUE)p