【发布时间】:2021-09-27 08:13:04
【问题描述】:
def doAnchoreGraph(image):
print(image)
info = infoAnchoreLog(image)
window = Toplevel()
window.title('Report '+ image)
window.geometry("1000x1000")
data = {'CVE': ['1. CRITICAL','2. HIGH','3. MEDIUM','4. LOW'],
'Frequency': [info[1],info[2],info[3],info[4]]
}
df = DataFrame(data,columns=['CVE','Frequency'])
figure = plt.Figure(figsize=(9,8), dpi=100)
ax = figure.add_subplot(111)
bar = FigureCanvasTkAgg(figure, window)
bar.get_tk_widget().pack(side=tk.LEFT, fill=tk.BOTH)
df = df[['CVE','Frequency']].groupby('CVE').sum()
df.plot(kind='bar', legend=True, ax=ax)
ax.set_title("Scanned Image: "+ image)
filename = "anchorescan-" + image + ".png"
figure.savefig(filename)
有人知道如何增加Y轴的极限吗?由于某种原因,我的上限为 20。这是我的示例输出: doAnchoreGraph.png
【问题讨论】:
-
ylim是你要搜索的函数。
标签: python-3.x matplotlib tkinter matplotlib-widget