To avoid overlapping (as in the scatterplot beside), it divides the plot area in a multitude of small fragment and represents the number of points in this fragment. There are several types of 2d density plots. Each has its properggplot2function. This post describes all of them. histogram)....
1.3 2-dimentional Density 二维密度曲线 > plot3 <- ggplot(iris,aes(x = Sepal.Length,y = Sepal.Width))+ theme_classic(base_size = 9)+ geom_point(shape = 17)+ geom_density_2d(linemitre = 5)+ theme(plot.title = element_text(hjust = 0.5))+ ggtitle("2-dimentional Density 二维密度曲...
##体重、腰围二维等高线图 p5<-ggplot(X,aes(weight,waist)) p5<-p5+stat_density2d()+geom_point...
这里对ggplot2几何对象进行汇总。 abline/area/bar/bin2d/boxplot/contour/crossbar/density/density2d/dotplot/errorbar/errorbarh/freqpoly/hex/histogram/hline/vline/jitter/line/linerange/point/pointrange/polygon/quantile/raster/rect/tile/ribbon/rug/segment/smooth/text/violin/path 具体...
与plot相似,qplot()的基本参数是x、y,分别代表所要绘制图像的x轴与y轴,并且为了和数据框高度契合(我也十分鼓励将变量都放进数据框中规整起来),qplot还提供了参数data,控制传入的数据框名称,这样在qplot()中涉及数据框中变量的参数就可以直呼其名而不用加$; ...
stat_bin2d stat_density2d stat_quantile stat_summary_hex stat_bindot stat_ecdf stat_smooth stat_unique stat_binhex stat_function stat_spoke stat_vline stat_boxplot stat_hline stat_sum stat_ydensity 1. 2. 3. 4. 5. 6. 六 坐标系统(Coordinante) ...
我想到一个办法是利用ggplot2分别画散点图和密度图,然后利用aplot包来拼图,aplot包是ggtree的作者新...
stat_bin2d stat_density2d stat_quantile stat_summary_hex stat_bindot stat_ecdf stat_smooth stat_unique stat_binhex stat_function stat_spoke stat_vline stat_boxplot stat_hline stat_sum stat_ydensity 六 坐标系统(Coordinante) 坐标系统控制坐标轴,可以进行变换,例如XY轴翻转,笛卡尔坐标和极坐标转换,...
geom_density()+ facet_grid(voice.part~.) #刻面 #4.5 二维(2D)数据密度图 stat_density_2d函数 str(faithful) p<-ggplot(faithful,aes(x=eruptions,y=waiting)) #1 默认使用等高线 p+geom_point()+ stat_density_2d() #2 可使用..level..将密度等高线的高度映射给等高线的颜色 ...
#使用stat_density2d作二维密度估计,并将等高线添加到散点图中 ggplot(data = df, mapping =aes(x = x, y = y))+geom_point()+stat_density2d() #使用大小与分布密度成正比例的点 ggplot(data = df, mapping = aes(x = x, y = y)) +stat_density2d(geom ='point', aes(size = ..density....