首页
学习
活动
专区
圈层
工具
发布
    • 综合排序
    • 最热优先
    • 最新优先
    时间不限
  • 来自专栏数据小魔方

    R语言可视化——柱形图美化(簇状、堆积、百分比)

    套用主题: ggplot(mydata,aes(Conpany,Sale,fill=Year))+geom_bar(stat="identity",position="dodge")+ggtitle(" ggplot(mydata,aes(Conpany,Sale,fill=Year))+geom_bar(stat="identity",position="dodge")+ggtitle("The Financial 堆积柱形图套用主题: ggplot(mydata,aes(Conpany,Sale,fill=Year))+geom_bar(stat="identity",position="stack")+ggtitle 堆积条形图: ggplot(mydata,aes(Conpany,Sale,fill=Year))+geom_bar(stat="identity",position="stack")+ggtitle( 百分比堆积条形图: ggplot(mydata,aes(Conpany,Sale,fill=Year))+geom_bar(stat="identity",position="fill")+ggtitle

    6.1K110发布于 2018-04-11
  • 来自专栏数据小魔方

    R语言可视化——多系列柱形图(条形图)与分面组图美化技巧!

    scale_fill_wsj("rgby", "")+theme(axis.ticks.length=unit(0.5,'cm'))+guides(fill=guide_legend(title=NULL))+ggtitle scale_fill_economist()+theme(axis.ticks.length=unit(0.5,'cm'))+guides(fill=guide_legend(title=NULL))+ggtitle scale_fill_economist()+theme(axis.ticks.length=unit(0.5,'cm'))+guides(fill=guide_legend(title=NULL))+ggtitle scale_fill_economist()+theme(axis.ticks.length=unit(0.5,'cm'))+guides(fill=guide_legend(title=NULL))+ggtitle scale_fill_economist()+theme(axis.ticks.length=unit(0.5,'cm'))+guides(fill=guide_legend(title=NULL))+ggtitle

    6.3K70发布于 2018-04-11
  • 来自专栏医学和生信笔记

    使用patchwork进行拼图的一些细节

    library(ggplot2) p1 <- ggplot(mtcars) + geom_point(aes(mpg, disp)) + ggtitle('Plot 1') p2 <- ggplot (mtcars) + geom_boxplot(aes(gear, disp, group = gear)) + ggtitle('Plot 2') p3 <- ggplot(mtcars ) + geom_point(aes(hp, wt, colour = mpg)) + ggtitle('Plot 3') p4 <- ggplot(mtcars) + geom_bar (aes(gear)) + facet_wrap(~cyl) + ggtitle('Plot 4') 简单拼图 使用起来真的是简单,直接用+连起来就行了。 (aes(gear)) + facet_wrap(~cyl) + ggtitle('Plot 4') 增加空白占位图形 顾名思义,增加几个空白图形,纯属占位子用的。

    6.1K40编辑于 2022-11-15
  • 来自专栏数据小魔方

    R语言可视化——面积(区域)图及其美化

    (fill=guide_legend(title=NULL)) ggplot(data5,aes(Year,Sale,fill=Fac))+geom_area(position="stack")+ggtitle guide_legend(title=NULL)) 百分比堆积: ggplot(data5,aes(Year,Sale,fill=Fac))+geom_area(position="fill")+ggtitle guides(fill=guide_legend(title=NULL)) ggplot(data5,aes(Year,Sale,fill=Fac))+geom_area(position="fill")+ggtitle fill=guide_legend(title=NULL)) 分面: ggplot(data5,aes(Year,Sale,fill=Fac))+geom_area(position="stack")+ggtitle ~Fac) ggplot(data5,aes(Year,Sale,fill=Fac))+geom_area(position="stack")+ggtitle("Area Plot")+theme_economist

    2.1K30发布于 2018-04-11
  • 来自专栏BioIT爱好者

    数据可视化完美指南-R-Python

    (x=date, y=value)) + geom_line(color="#69b3a2") + geom_point(color="#69b3a2", size=4) + ggtitle p1 <- data %>% tail(60) %>% ggplot( aes(x=date, y=value)) + geom_line(color="#69b3a2") + ggtitle (x=date, y=value)) + geom_line(color="#69b3a2") + geom_point(color="#69b3a2", size=2) + ggtitle %>% tail(60) %>% ggplot( aes(x=date, y=value)) + geom_point(color="#69b3a2", size=2) + ggtitle (x=date, y=value)) + geom_line(color="#69b3a2") + geom_point(color="#69b3a2", size=4) + ggtitle

    72430发布于 2021-10-15
  • 来自专栏数据科学(冷冻工厂)

    空间转录组学: 全局异常值检测

    scatter", x_metric = "cell_count", y_metric = "sum", y_threshold = 600) + ggtitle 600 UMI)") p2 <- plotObsQC(spe, plot_type = "spot", annotate = "qc_detected") + ggtitle genes)") p3 <- plotObsQC(spe, plot_type = "spot", annotate = "qc_mito_prop") + ggtitle threshold p1 <- plotObsQC(spe, plot_type = "spot", annotate = "qc_lib_size_2000") + ggtitle (spe, x = "ground_truth", y = "sum", colour_by = "ground_truth") + ggtitle

    24210编辑于 2025-09-17
  • 来自专栏数据小魔方

    R语言可视化——图表美化与套用主题(下)

    (conpany,-Revenue),Revenue))+geom_bar(stat="identity")+labs(x="Company",y="The Revenue of 2015($)")+ggtitle (conpany,-Revenue),Revenue))+geom_bar(stat="identity")+labs(x="Company",y="The Revenue of 2015($)")+ggtitle (conpany,-Revenue),Revenue))+geom_bar(stat="identity")+labs(x="Company",y="The Revenue of 2015($)")+ggtitle ),Revenue,fill="steelbule"))+geom_bar(stat="identity")+labs(x="Company",y="The Revenue of 2015($)")+ggtitle ),Revenue,fill="steelbule"))+geom_bar(stat="identity")+labs(x="Company",y="The Revenue of 2015($)")+ggtitle

    1.4K60发布于 2018-04-11
  • 来自专栏BioIT爱好者

    ggplot2 图形排版:patchwork 包简单入门

    p1 <- ggplot(mtcars, aes(x=mpg, y=wt)) + geom_point() +ggtitle('图1') p2 <- ggplot(mtcars, aes(x= mpg, y=disp, group = gear)) + geom_boxplot() + ggtitle('图2') p3 <- ggplot(mtcars, aes(x=hp, y=wt, colour = mpg)) + geom_point() + ggtitle('图3') p4 <- ggplot(mtcars, aes(x=gear)) + geom_bar() + ggtitle('图4') + facet_wrap(~cyl) p1 + p2 + p3 + p4 3.

    1.4K20发布于 2021-10-15
  • 来自专栏优雅R

    patternplot包:用ggplot解决你对线性填充,不!所有填充的全部幻想。

    density=c(8, 8, 30)# 设置填充的密度 # ) pie1 pie1<-pie1+ggtitle 0.005, r2=4, r3=4.75) g2<-g+scale_x_continuous(limits=c(-6, 6))+scale_y_continuous(limits=c(-6, 6))+ggtitle hjust=0.5,legend.pixel=6, legend.w=0.275,legend.x.pos=1.1) +scale_y_continuous(limits = c(0, 3100))+ggtitle pattern.type,frame.color=c('orange','darkred', 'darkgreen'),legend.label="", ylab='Weight, Pounds')+ggtitle , 4),frame.color=c('black', 'black', 'black'), density=density, vjust=2, hjust=0.5, bar.width=0.75)+ggtitle

    2.9K20发布于 2020-07-03
  • 来自专栏数据 学术 商业 新闻

    绘图技巧 | 河流图绘制技巧分享(样例数据分享)

    , box_office, fill = genre)) + theme(legend.position = "none") (base + geom_stream(bw = 0.5) + ggtitle ("bw = 0.5")) / (base + geom_stream() + ggtitle("Default (bw = 0.75)")) / (base + geom_stream(bw = fill = genre)) + theme(legend.position = "none") + xlim(1970, 2028) (base + geom_stream() + ggtitle geom_stream(extra_span = 0.001) + geom_stream(extra_span = 0.001, true_range = "none", alpha = .3) + ggtitle ("extra_span = .2")) / (base + geom_stream(extra_span = .2, true_range = "none") + ggtitle("extra_span

    3.5K20发布于 2021-03-26
  • 来自专栏生信小驿站

    R语言之可视化①④一页多图(1)目录

    plot p1 <- ggplot(ChickWeight, aes(x=Time, y=weight, colour=Diet, group=Chick)) + geom_line() + ggtitle aes(x=Time, y=weight, colour=Diet)) + geom_point(alpha=.3) + geom_smooth(alpha=.2, size=1) + ggtitle plot p3 <- ggplot(subset(ChickWeight, Time==21), aes(x=weight, colour=Diet)) + geom_density() + ggtitle (x=weight, fill=Diet)) + geom_histogram(colour="black", binwidth=50) + facet_grid(Diet ~ .) + ggtitle

    1.1K30发布于 2018-12-14
  • 来自专栏简说基因

    R语言图形拼接神器:Patchwork包入门指南

    library(ggplot2) library(patchwork) p1 <- ggplot(mpg) + geom_point(aes(x = displ, y = hwy)) + ggtitle + geom_bar(aes(x = as.character(year), fill = drv), position = "dodge") + labs(x = "year") + ggtitle ggplot(mpg) + geom_density(aes(x = hwy, fill = drv), colour = NA) + facet_grid(rows = vars(drv)) + ggtitle mean_se) + stat_summary(aes(x = drv, y = hwy), geom = "errorbar", fun.data = mean_se, width = 0.5) + ggtitle

    88010编辑于 2024-12-23
  • 来自专栏数据驱动实践

    R语言绘制靓图--ggthemr、gsci、tvthemes主题包

    repr.plot.res = 300) ggthemr('grape') ggplot(mpg, aes(manufacturer, hwy)) + geom_boxplot() + ggtitle ", binwidth = 1, position = "dodge") + theme_bw() 2.1 NPG p1_npg = p1 + scale_color_npg() + ggtitle ("scale_color_npg()") p2_npg = p2 + scale_fill_npg() + ggtitle("scale_fill_npg()") grid.arrange(p1_npg , p2_npg, ncol = 2) 2.2 AAAS p1_aaas = p1 + scale_color_aaas() + ggtitle("scale_color_aaas()") p2_aaas = p2 + scale_fill_aaas() + ggtitle("scale_fill_aaas()") grid.arrange(p1_aaas, p2_aaas, ncol = 2) 更多图片示例

    81930发布于 2021-10-11
  • 来自专栏数据小魔方

    R语言可视化——散点图及其美化技巧!

    以上散点图都没有考虑过美化的问题;这里通过添加主题、颜色模板可以将其美化: ggplot(diamonds,aes(carat,price))+geom_point(aes(colour=cut))+ggtitle ggplot(diamonds,aes(carat,price))+geom_point(aes(colour=cut,size=table))+ggtitle("Scatter Plot")+theme_wsj ggplot(diamonds,aes(carat,price))+geom_point(aes(colour=cut,size=table))+ggtitle("Scatter Plot")+theme_economist 想要看某一个区域内的具体分布情况,只需要添加xlim()、ylim()参数即可: ggplot(diamonds,aes(carat,price))+geom_point(aes(colour=cut,size=table))+ggtitle ggplot(diamonds,aes(carat,price))+geom_point(aes(colour=cut,size=table))+ggtitle("Scatter Plot")+theme_economist

    2.7K100发布于 2018-04-11
  • 来自专栏生信技能树

    (IF=14.5)11个高分杂志的scATAC-seq数据分析实战:GSE173682(paper代码学习)

    depth.cluster),     xlabel = "log10(unique fragments)",     ylabel = "log10(TSS Enrichment+1)"   ) + ggtitle dashed") +     geom_vline(xintercept = min(log10(df.depth$proj.i.nFrags)),linetype = "dashed") +     ggtitle dashed") +     geom_vline(xintercept = min(log10(df.depth$proj.i.nFrags)),linetype = "dashed") +     ggtitle "dashed")+     geom_vline(xintercept = min(log10(df.depth$proj.i.nFrags)),linetype = "dashed")+     ggtitle "dashed")+     geom_vline(xintercept = min(log10(df.depth$proj.i.nFrags)),linetype = "dashed")+     ggtitle

    28200编辑于 2025-06-09
  • 来自专栏单细胞天地

    单细胞分析十八般武艺2:LIGER

    ") p3 = DimPlot(scRNA, group.by="seurat_clusters", label=T, label.size=2) + ggtitle("Clustered by seurat ") p4 = DimPlot(scRNA, group.by="clusters", label=T, label.size=2) + ggtitle("Clustered by liger") plot1 ") p3 = DimPlot(scRNA, group.by="seurat_clusters", label=T, label.size=3) + ggtitle("Clustered by seurat ") p4 = DimPlot(scRNA, group.by="clusters", label=T, label.size=3) + ggtitle("Clustered by liger") plot1 ("lambda=5") p2 = DimPlot(scRNA.x, group.by="orig.ident", pt.size=0.05) + ggtitle("lambda=0.25") p3 =

    6.1K61发布于 2021-04-16
  • 来自专栏免疫组库研究

    【生信分析】免疫组库基础分析10-CDR3 氨基酸理化性质分析

    all four of the properties g1 <- ggplot(db_props, aes(x=c_call, y=cdr3_aa_length)) + tmp_theme + ggtitle geom_boxplot(aes(fill=c_call)) g2 <- ggplot(db_props, aes(x=c_call, y=cdr3_aa_gravy)) + tmp_theme + ggtitle geom_boxplot(aes(fill=c_call)) g3 <- ggplot(db_props, aes(x=c_call, y=cdr3_aa_basic)) + tmp_theme + ggtitle geom_boxplot(aes(fill=c_call)) g4 <- ggplot(db_props, aes(x=c_call, y=cdr3_aa_acidic)) + tmp_theme + ggtitle

    17010编辑于 2025-10-20
  • 来自专栏作图丫

    强烈安利!!绘制可自定义填充图案的统计图-patternplot

    饼图的像素分辨率 density=c(8, 8, 10) #填充图案的线/点的密度 ) pie1<-pie1+ggtitle ('(A) Black and White with Patterns') #ggtitle给饼图加标题 2. burlywood4', frame.size=0.8, label.size=6, label.color='forestgreen')+ ggtitle r2=4, r3=4.75) g2<-g+scale_x_continuous(limits=c(-6, 6))+ scale_y_continuous(limits=c(-6, 6))+ ggtitle 'black', 'black'), density=density)+ scale_y_continuous(limits = c(0, 2800))+ ggtitle

    1.6K21编辑于 2022-03-29
  • 来自专栏数据小魔方

    R语言可视化——箱线图及其美化技巧

    facet_wrap(~color) 仔细体会两种分面函数效果的差异: 箱线图美化: 簇状: ggplot(diamonds,aes(cut,price,fill=color))+geom_boxplot()+ggtitle ()+guides(fill=guide_legend(title=NULL)) ggplot(diamonds,aes(cut,price,fill=color))+geom_boxplot()+ggtitle guides(fill=guide_legend(title=NULL)) 分面: ggplot(diamonds,aes(cut,price,fill=color))+geom_boxplot()+ggtitle ~color) ggplot(diamonds,aes(cut,price,fill=color))+geom_boxplot()+ggtitle("Box Plot")+theme_economist

    3.8K70发布于 2018-04-11
  • 来自专栏深度学习之tensorflow实战篇

    r语言ggplot2包学习笔记(上代码+注释)

    2,4,6), label=c("a","b","c") ) p<- ggplot(df,aes(x,y,label=label))+xlab(NULL)+ylab(NULL) p+geom_point()+ggtitle ("geom_point")#散点效果+title p+geom_bar(stat="identity")+ggtitle("geom_bar(stat=\"identity\")") #柱形图。。。 注意"需要加\才能引用 p+geom_line()+ggtitle("geom_line")#线图 p+geom_area()+ggtitle("geom_area")#填黑线图 p+geom_path ()+ggtitle("geom_path")#路径图 p+geom_tile()+ggtitle("geom_tile")#瓦片图 p+geom_polygon()+ggtitle("geom_polygon

    2.4K50发布于 2018-03-16
领券