1.1 散点图(Scatterplot) 1.2 带边界的散点图(Scatterplot With Encircling) 1.3 抖动图(Jitter Plot) 1.4 计数图(Counts Chart) 1.5 气泡图(Bubble Plot) 1.6 边际直方图/箱线图(Marginal Histogram / Boxplot) ...
# Scatterplot# 画散点图gg<-ggplot(midwest,aes(x=area,y=poptotal))+geom_point(aes(col=state,size=popdensity))+# 画平滑曲线geom_smooth(method="loess",se=F)+xlim(c(0,0.1))+ylim(c(0,500000))+labs(subtitle="Area Vs Population",y="Population",x="Area",title="Scatterplot",caption="...
# Scatter plot sp + scale_color_brewer(palette="Dark2") RColorBrewer包提供以下调色板 还专门有一个灰度调色板: # Box plot bp + scale_fill_grey() + theme_classic() # Scatter plot sp + scale_color_grey() + theme_classic() 梯度或连续颜色 有时我们会将某个连续变量映射给颜色,这时修改这种...
1、边界散点图(Scatterplot With Encircling) options(scipen = 999) library(ggplot2) library(ggalt) midwest_select <- midwest[midwest$poptotal > 350000 & midwest$poptotal <= 500000 & midwest$area > 0.01 & midwest$area < 0.1, ] # Plot ggplot(midwest, aes(x=area, y=poptotal)) + geom_p...
title = "Temperature correlation curves", subtitle = "Scatter plot of daily temperature changes", caption = "Data:XXX", tag = "Fig. 1") 1. 2. 3. 4. 5. 6. 7. 加粗标题:可以在theme主题中设置标题的显示格式,比如字体大小、颜色、粗细、形状等等。
qplot(): Quick plot with ggplot2 Scatter plots Bar plot Box plot, violin plot and dot plot Histogram and density plots Box plots Basic box plots Box plot with dots Change box plot colors by groups Change box plot line colors Change box plot fill colors ...
title="Scatterplot", caption = "Source: midwest") plot(gg) 带圈的散点图 展示结果时,在图中圈出特定的点有注意吸引注意力,使用ggalt包中的geom_encircle() 可以方便实现 在geom_encircle()中把数据 data 设为只包括兴趣点的数据框 并且 你可以 expand 曲线使其刚好绕过点的外围. 曲线的颜色 粗细也能...
GGally:GGallyextends ggplot2 for visualizingcorrelation matrix,scatterplot plot matrix,survival plotand more. ggRandomForests: Graphical analysis ofrandom forestswith the randomForestSRC and ggplot2 packages. ggdendro: Create dendrograms and tree diagrams using ggplot2 ...
bp <- ggplot(ToothGrowth, aes(x=dose, y=len)) # scatter plot sp <- ggplot(mtcars, aes(x=wt, y=mpg)) 修改填充色、轮廓线颜色 bp+geom_boxplot(fill="steelblue", color="red") sp+geom_point(color="darkblue") 通过映射分组修改颜色...
今天第一幅图是散点图(scatterplot) 散点图是数据分析中非常常用的一种形式(The most frequently used plot for data analysis is undoubtedly the scatterplot);如果你想初步了解两个变量之间的关系,第一选择一定是散点图(Whenever you want to understand the nature of relationship between two variables, invari...