我们的数据可视化课程已经上线啦!!目前课程的主要方向是 科研、统计、地理相关的学术性图形绘制方法,后续也会增加商务插图、机器学等、数据分析等方面的课程。课程免费新增,这点绝对良心!
我们第一个数据可视化交流圈子也已经上线了,主要以我的第一本书籍《科研论文配图绘制指南-基于Python》为基础进行拓展,提供「课堂式」教学视频,还有更多拓展内容,可视化技巧远超书籍本身,书籍修正和新增都会分享到圈子里面~~
参与课程或者圈子的你将获取到:学员答疑、可视化资源分享、可视化技巧补充、可视化业务代做(学员和甲方对接)、副业交流、提升认知等等。
今天找资料的时候,又发现了一个“哇塞”的数据可视化工具-「fishplot」,用于绘制时间进程 鱼图,专门显示肿瘤克隆结构的变化。医学类的同学赶紧用起来啦~~
#install devtools if you don't have it already for easy installation
install.packages("devtools")
library(devtools)
install_github("chrisamiller/fishplot")
library(fishplot)
#provide a list of timepoints to plot
#You may need to add interpolated points to end up with the desired
#visualization. Example here was actually sampled at days 0 and 150
timepoints=c(0,30,75,150)
#provide a matrix with the fraction of each population
#present at each timepoint
frac.table = matrix(
c(100, 45, 00, 00,
02, 00, 00, 00,
02, 00, 02, 01,
98, 00, 95, 40),
ncol=length(timepoints))
#provide a vector listing each clone's parent
#(0 indicates no parent)
parents = c(0,1,1,3)
#create a fish object
fish = createFishObject(frac.table,parents,timepoints=timepoints)
#calculate the layout of the drawing
fish = layoutClones(fish)
#draw the plot, using the splining method (recommended)
#and providing both timepoints to label and a plot title
fishPlot(fish,shape="spline",title.btm="Sample1",
cex.title=0.5, vlines=c(0,150),
vlab=c("day 0","day 150"))
还可以实现下面的可视化效果:
好了,更多关于fishplot包的语法和案例,大家课参考:fishplot官网[1]
参考资料
[1]
fishplot官网: https://github.com/chrisamiller/fishplot?tab=readme-ov-file。