Draw a Split Density PlotJason Waddell
导出高清图的方法在这里:R语言作图技巧——导出高清图R语言作图系列还有:R语言作图——Beeswarm(蜜蜂图)R语言作图——Circular bar plot(环形柱状图)R语言作图——3D scatter(3D散点图)R语言作图——Line plot with colored backgroundR语言作图——Scatter plot with marginal densityR语言作图——Dumbbell plot(哑铃...
Whitespace Ignore whitespace Split Unified 20 changes: 20 additions & 0 deletions 20 plot_density.R @@ -0,0 +1,20 @@ # method 1 ggplot library(ggplot2) data <- read.table("all.fst", sep="\t", header=T) data$Group <- factor(data$Group, levels=c("Simulated","Observed ")) ...
76_split_screen_function.Rmd 76_split_screen_function.html 77-turn-y-axis-upside-down.Rmd 77-turn-y-axis-upside-down.html 78-levelplot-from-a-square-matrix.html 79-levelplot-with-ggplot2.Rmd 79-levelplot-with-ggplot2.html 81-barplot-with-variable-width.Rmd 81-barplot-with-...
Split the plot in multiple panels : p<-ggplot(df, aes(x=weight))+ geom_density()+facet_grid(sex ~ .) p # Add mean lines p+geom_vline(data=mu, aes(xintercept=grp.mean, color="red"), linetype="dashed") Read more on facets : ggplot2 facets Customized density plots # Basic...
The facet approach splits a plot into a matrix of panels. Each panel shows a different subset of the data. Facet with one variable #Facet according to the sex variable ggplot2.density(data=weight, xName='weight', groupName='sex', legendPosition="top", faceting=TRUE, facetingVarNames...
首先要把你想要绘图的数据调整成R语言可以识别的格式,建议大家在excel中保存成csv格式。 作图数据格式如下: (今天偷懒啦,直接借用了iris数据集) 数据格式 Step2.绘图数据的读取 代码语言:javascript 复制 data<-read.csv(“your file path”,header=T,check.names=F)#注释:header=T表示数据中的第一行是列名,如...
Whitespace Ignore whitespace Split Unified 21 changes: 17 additions & 4 deletions 21 sp_densityHistPlot.sh Original file line numberDiff line numberDiff line change @@ -117,6 +117,11 @@ ${txtbld}OPTIONS${txtrst}: -I Manually set xtics.${bldred}[Default FALSE, accept a series of nu...
} \examples{ irisDist <- dist(iris[,1:4]) irisClust <- densityClust(irisDist, gaussian=TRUE) plot(irisClust) # Inspect clustering attributes to define thresholds irisClust <- findClusters(irisClust, rho=2, delta=2) plotMDS(irisClust) split(iris[,5], irisClust$clusters) } \seealso{ ...
上次分享了小提琴曲线(violin plot)的作图方法,今天小仙同学给大家介绍一下如何用R画出漂亮的密度图(density plot)。 Step1.绘图数据的准备 首先还是要把你想要绘图的数据调整成R语言可以识别的格式excel中保存成csv格式。 数据的格式如下图:一列表示一种变量,第一行是列名 ...