python - Python中的线段绘图
问题描述
我正在尝试绘制数据以进行研究。它应该看起来像这样,
这是用 R 绘制的。我想知道是否有任何方法可以在 Python 中绘制这样的东西?每个段都有自己的起点和终点,它们来自 中的 2 个变量x
。y
只是样本的 ID。
这是R代码,
df <- read.table("df.hom",header=T,stringsAsFactors = F)
p1 <- ggplot(df[which(df$PHE == 2),])
p1 <- p1 + geom_segment(aes(x=POS1, xend=POS2, y=IID, yend=IID), size=5)
p1 <- p1 + xlab("Position (in Mb)") + ylab("Sample")
p1 <- p1 + theme_bw()
p1
解决方案
推荐阅读
- docker - 在 .net 核心应用程序中获取 Docker 容器 IP
- yii2 - 对用户密码散列 Yii2 使用不同的盐
- sql - TSQL 函数 新列的两个子字符串
- c# - 如何将 DataTable 移动到另一个 DataSet?
- typescript - ng2-file-upload 响应范围
- javascript - 在内部渲染多个反应组件
- 带按钮 onclick
- javascript - Django + Vue.js 导入模块
- c# - MySQL 8.0 concat 从 mediumtext 列返回 system.byte[]
- javascript - 将默认道具样式与内联样式相结合
- android - 如何使用连续动态旋转角度值在android中使用opengl旋转imageview