1 Star 0 Fork 0

wkh/keti-python-rugp

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
original_graphic_4_gram.py 961 Bytes
一键复制 编辑 原始数据 按行查看 历史
wkh 提交于 2024-01-26 21:48 . feat: keti python
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
# 设置matplotlib支持中文的字体,这里使用SimHei字体
plt.rcParams['font.sans-serif'] = ['SimHei'] # 指定默认字体
plt.rcParams['axes.unicode_minus'] = False # 解决保存图像是负号'-'显示为方块的问题
# Assume we have some example data for 4-gram frequencies
# This is a 8x8 grid for a graphical password with each cell representing a grid point
# For simplicity, the data is generated randomly
np.random.seed(0)
example_data = np.random.rand(8, 8)
# Create a heatmap to visualize the 4-Gram frequencies
plt.figure(figsize=(10, 8))
sns.heatmap(example_data, annot=True, fmt=".2f", cmap="YlGnBu", square=True)
# plt.title('Heatmap Representation of 4-Gram Model Frequencies')
plt.title('Original: 4-Gram模型频率的热图表示')
plt.xlabel('Grid Points (X 轴)')
plt.ylabel('Grid Points (Y 轴)')
# Show the plot
plt.tight_layout()
plt.show()
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/wkhn1/keti-python-rugp.git
git@gitee.com:wkhn1/keti-python-rugp.git
wkhn1
keti-python-rugp
keti-python-rugp
master

搜索帮助

23e8dbc6 1850385 7e0993f3 1850385