代码拉取完成,页面将自动刷新
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()
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。