python - Python 无论如何要在矩阵中显示序列标签 TCAG?全球对齐
问题描述
%matplotlib inline
import matplotlib.pyplot as plt
plt.figure(figsize=(25,25))
plt.imshow(alignment_matrix, cmap='Pastel1')
plt.title("Alignment Matrix", size=30)
tick_marks = np.arange(0)
#plt.xticks(tick_marks, [sequence_1[0], sequence_1[1], sequence_1[2], sequence_1[3]], size=10)
#plt.yticks(tick_marks, [sequence_2[0], sequence_2[1], sequence_2[2], sequence_2[3]], size=10)
plt.xticks(tick_marks)
plt.yticks(tick_marks)
#plt.tight_layout()
plt.xlabel("Sequence 1", size=20)
plt.ylabel("Sequence 2", size=20)
w, h = alignment_matrix.shape
for x in range(w):
for y in range(h):
plt.annotate(str(alignment_matrix[x][y]), xy=(y,x), horizontalalignment='center', verticalalignment='center', size=20)
plt.show()
此代码的链接:https ://drive.google.com/file/d/1HXoB8zWUvwyCViORIKesjrkmj7VVOvOE/view?usp=sharing
解决方案
推荐阅读
- node.js - npm 未安装,但仍然在 npm -v 上显示版本
- java - 如何修复具有不需要的 R 子类的项目类
- javascript - 使用 Node.js 提供动态内容并在一段时间后更新
- java - 为什么我在 Android 上遇到 ExifInterface 的 File not found 错误?
- c++ - glm::perspective 的 fov 参数是否定义为视野角度的一半?
- javascript - vscode 有什么插件可以立即输入console.log() 来评论?
- php - 用新的短代码替换旧的短代码
- vb.net - 未安装 VS 的计算机上的 VB.net 应用程序“无法加载文件或程序集”
- python-3.x - 尝试使用漂亮的汤从 html 表中抓取特定数据
- c++ - GDB:[无可用来源]